
bin/kernel_nopage:     file format elf32-i386


Disassembly of section .text:

00100000 <kern_entry>:

.text
.globl kern_entry
kern_entry:
    # load pa of boot pgdir
    movl $REALLOC(__boot_pgdir), %eax
  100000:	b8 00 a0 11 40       	mov    $0x4011a000,%eax
    movl %eax, %cr3
  100005:	0f 22 d8             	mov    %eax,%cr3

    # enable paging
    movl %cr0, %eax
  100008:	0f 20 c0             	mov    %cr0,%eax
    orl $(CR0_PE | CR0_PG | CR0_AM | CR0_WP | CR0_NE | CR0_TS | CR0_EM | CR0_MP), %eax
  10000b:	0d 2f 00 05 80       	or     $0x8005002f,%eax
    andl $~(CR0_TS | CR0_EM), %eax
  100010:	83 e0 f3             	and    $0xfffffff3,%eax
    movl %eax, %cr0
  100013:	0f 22 c0             	mov    %eax,%cr0

    # update eip
    # now, eip = 0x1.....
    leal next, %eax
  100016:	8d 05 1e 00 10 00    	lea    0x10001e,%eax
    # set eip = KERNBASE + 0x1.....
    jmp *%eax
  10001c:	ff e0                	jmp    *%eax

0010001e <next>:
next:

    # unmap va 0 ~ 4M, it's temporary mapping
    xorl %eax, %eax
  10001e:	31 c0                	xor    %eax,%eax
    movl %eax, __boot_pgdir
  100020:	a3 00 a0 11 00       	mov    %eax,0x11a000

    # set ebp, esp
    movl $0x0, %ebp
  100025:	bd 00 00 00 00       	mov    $0x0,%ebp
    # the kernel stack region is from bootstack -- bootstacktop,
    # the kernel stack size is KSTACKSIZE (8KB)defined in memlayout.h
    movl $bootstacktop, %esp
  10002a:	bc 00 90 11 00       	mov    $0x119000,%esp
    # now kernel stack is ready , call the first C function
    call kern_init
  10002f:	e8 02 00 00 00       	call   100036 <kern_init>

00100034 <spin>:

# should never get here
spin:
    jmp spin
  100034:	eb fe                	jmp    100034 <spin>

00100036 <kern_init>:
int kern_init(void) __attribute__((noreturn));
void grade_backtrace(void);
static void lab1_switch_test(void);

int
kern_init(void) {
  100036:	55                   	push   %ebp
  100037:	89 e5                	mov    %esp,%ebp
  100039:	83 ec 28             	sub    $0x28,%esp
    extern char edata[], end[];
    memset(edata, 0, end - edata);
  10003c:	b8 8c cf 11 00       	mov    $0x11cf8c,%eax
  100041:	2d 36 9a 11 00       	sub    $0x119a36,%eax
  100046:	89 44 24 08          	mov    %eax,0x8(%esp)
  10004a:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  100051:	00 
  100052:	c7 04 24 36 9a 11 00 	movl   $0x119a36,(%esp)
  100059:	e8 f0 5e 00 00       	call   105f4e <memset>

    cons_init();                // init the console
  10005e:	e8 42 15 00 00       	call   1015a5 <cons_init>

    const char *message = "(THU.CST) os is loading ...";
  100063:	c7 45 f4 e0 60 10 00 	movl   $0x1060e0,-0xc(%ebp)
    cprintf("%s\n\n", message);
  10006a:	8b 45 f4             	mov    -0xc(%ebp),%eax
  10006d:	89 44 24 04          	mov    %eax,0x4(%esp)
  100071:	c7 04 24 fc 60 10 00 	movl   $0x1060fc,(%esp)
  100078:	e8 e9 02 00 00       	call   100366 <cprintf>

    print_kerninfo();
  10007d:	e8 07 08 00 00       	call   100889 <print_kerninfo>

    grade_backtrace();
  100082:	e8 95 00 00 00       	call   10011c <grade_backtrace>

    pmm_init();                 // init physical memory management
  100087:	e8 39 44 00 00       	call   1044c5 <pmm_init>

    pic_init();                 // init interrupt controller
  10008c:	e8 95 16 00 00       	call   101726 <pic_init>
    idt_init();                 // init interrupt descriptor table
  100091:	e8 f9 17 00 00       	call   10188f <idt_init>

    clock_init();               // init clock interrupt
  100096:	e8 69 0c 00 00       	call   100d04 <clock_init>
    intr_enable();              // enable irq interrupt
  10009b:	e8 e4 15 00 00       	call   101684 <intr_enable>

    //LAB1: CAHLLENGE 1 If you try to do it, uncomment lab1_switch_test()
    // user/kernel mode switch test
    lab1_switch_test();
  1000a0:	e8 76 01 00 00       	call   10021b <lab1_switch_test>

    /* do nothing */
    while (1);
  1000a5:	eb fe                	jmp    1000a5 <kern_init+0x6f>

001000a7 <grade_backtrace2>:
}

void __attribute__((noinline))
grade_backtrace2(int arg0, int arg1, int arg2, int arg3) {
  1000a7:	55                   	push   %ebp
  1000a8:	89 e5                	mov    %esp,%ebp
  1000aa:	83 ec 18             	sub    $0x18,%esp
    mon_backtrace(0, NULL, NULL);
  1000ad:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  1000b4:	00 
  1000b5:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  1000bc:	00 
  1000bd:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  1000c4:	e8 56 0b 00 00       	call   100c1f <mon_backtrace>
}
  1000c9:	90                   	nop
  1000ca:	89 ec                	mov    %ebp,%esp
  1000cc:	5d                   	pop    %ebp
  1000cd:	c3                   	ret    

001000ce <grade_backtrace1>:

void __attribute__((noinline))
grade_backtrace1(int arg0, int arg1) {
  1000ce:	55                   	push   %ebp
  1000cf:	89 e5                	mov    %esp,%ebp
  1000d1:	83 ec 18             	sub    $0x18,%esp
  1000d4:	89 5d fc             	mov    %ebx,-0x4(%ebp)
    grade_backtrace2(arg0, (int)&arg0, arg1, (int)&arg1);
  1000d7:	8d 4d 0c             	lea    0xc(%ebp),%ecx
  1000da:	8b 55 0c             	mov    0xc(%ebp),%edx
  1000dd:	8d 5d 08             	lea    0x8(%ebp),%ebx
  1000e0:	8b 45 08             	mov    0x8(%ebp),%eax
  1000e3:	89 4c 24 0c          	mov    %ecx,0xc(%esp)
  1000e7:	89 54 24 08          	mov    %edx,0x8(%esp)
  1000eb:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  1000ef:	89 04 24             	mov    %eax,(%esp)
  1000f2:	e8 b0 ff ff ff       	call   1000a7 <grade_backtrace2>
}
  1000f7:	90                   	nop
  1000f8:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  1000fb:	89 ec                	mov    %ebp,%esp
  1000fd:	5d                   	pop    %ebp
  1000fe:	c3                   	ret    

001000ff <grade_backtrace0>:

void __attribute__((noinline))
grade_backtrace0(int arg0, int arg1, int arg2) {
  1000ff:	55                   	push   %ebp
  100100:	89 e5                	mov    %esp,%ebp
  100102:	83 ec 18             	sub    $0x18,%esp
    grade_backtrace1(arg0, arg2);
  100105:	8b 45 10             	mov    0x10(%ebp),%eax
  100108:	89 44 24 04          	mov    %eax,0x4(%esp)
  10010c:	8b 45 08             	mov    0x8(%ebp),%eax
  10010f:	89 04 24             	mov    %eax,(%esp)
  100112:	e8 b7 ff ff ff       	call   1000ce <grade_backtrace1>
}
  100117:	90                   	nop
  100118:	89 ec                	mov    %ebp,%esp
  10011a:	5d                   	pop    %ebp
  10011b:	c3                   	ret    

0010011c <grade_backtrace>:

void
grade_backtrace(void) {
  10011c:	55                   	push   %ebp
  10011d:	89 e5                	mov    %esp,%ebp
  10011f:	83 ec 18             	sub    $0x18,%esp
    grade_backtrace0(0, (int)kern_init, 0xffff0000);
  100122:	b8 36 00 10 00       	mov    $0x100036,%eax
  100127:	c7 44 24 08 00 00 ff 	movl   $0xffff0000,0x8(%esp)
  10012e:	ff 
  10012f:	89 44 24 04          	mov    %eax,0x4(%esp)
  100133:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  10013a:	e8 c0 ff ff ff       	call   1000ff <grade_backtrace0>
}
  10013f:	90                   	nop
  100140:	89 ec                	mov    %ebp,%esp
  100142:	5d                   	pop    %ebp
  100143:	c3                   	ret    

00100144 <lab1_print_cur_status>:

static void
lab1_print_cur_status(void) {
  100144:	55                   	push   %ebp
  100145:	89 e5                	mov    %esp,%ebp
  100147:	83 ec 28             	sub    $0x28,%esp
    static int round = 0;
    uint16_t reg1, reg2, reg3, reg4;
    asm volatile (
  10014a:	8c 4d f6             	mov    %cs,-0xa(%ebp)
  10014d:	8c 5d f4             	mov    %ds,-0xc(%ebp)
  100150:	8c 45 f2             	mov    %es,-0xe(%ebp)
  100153:	8c 55 f0             	mov    %ss,-0x10(%ebp)
            "mov %%cs, %0;"
            "mov %%ds, %1;"
            "mov %%es, %2;"
            "mov %%ss, %3;"
            : "=m"(reg1), "=m"(reg2), "=m"(reg3), "=m"(reg4));
    cprintf("%d: @ring %d\n", round, reg1 & 3);
  100156:	0f b7 45 f6          	movzwl -0xa(%ebp),%eax
  10015a:	83 e0 03             	and    $0x3,%eax
  10015d:	89 c2                	mov    %eax,%edx
  10015f:	a1 00 c0 11 00       	mov    0x11c000,%eax
  100164:	89 54 24 08          	mov    %edx,0x8(%esp)
  100168:	89 44 24 04          	mov    %eax,0x4(%esp)
  10016c:	c7 04 24 01 61 10 00 	movl   $0x106101,(%esp)
  100173:	e8 ee 01 00 00       	call   100366 <cprintf>
    cprintf("%d:  cs = %x\n", round, reg1);
  100178:	0f b7 45 f6          	movzwl -0xa(%ebp),%eax
  10017c:	89 c2                	mov    %eax,%edx
  10017e:	a1 00 c0 11 00       	mov    0x11c000,%eax
  100183:	89 54 24 08          	mov    %edx,0x8(%esp)
  100187:	89 44 24 04          	mov    %eax,0x4(%esp)
  10018b:	c7 04 24 0f 61 10 00 	movl   $0x10610f,(%esp)
  100192:	e8 cf 01 00 00       	call   100366 <cprintf>
    cprintf("%d:  ds = %x\n", round, reg2);
  100197:	0f b7 45 f4          	movzwl -0xc(%ebp),%eax
  10019b:	89 c2                	mov    %eax,%edx
  10019d:	a1 00 c0 11 00       	mov    0x11c000,%eax
  1001a2:	89 54 24 08          	mov    %edx,0x8(%esp)
  1001a6:	89 44 24 04          	mov    %eax,0x4(%esp)
  1001aa:	c7 04 24 1d 61 10 00 	movl   $0x10611d,(%esp)
  1001b1:	e8 b0 01 00 00       	call   100366 <cprintf>
    cprintf("%d:  es = %x\n", round, reg3);
  1001b6:	0f b7 45 f2          	movzwl -0xe(%ebp),%eax
  1001ba:	89 c2                	mov    %eax,%edx
  1001bc:	a1 00 c0 11 00       	mov    0x11c000,%eax
  1001c1:	89 54 24 08          	mov    %edx,0x8(%esp)
  1001c5:	89 44 24 04          	mov    %eax,0x4(%esp)
  1001c9:	c7 04 24 2b 61 10 00 	movl   $0x10612b,(%esp)
  1001d0:	e8 91 01 00 00       	call   100366 <cprintf>
    cprintf("%d:  ss = %x\n", round, reg4);
  1001d5:	0f b7 45 f0          	movzwl -0x10(%ebp),%eax
  1001d9:	89 c2                	mov    %eax,%edx
  1001db:	a1 00 c0 11 00       	mov    0x11c000,%eax
  1001e0:	89 54 24 08          	mov    %edx,0x8(%esp)
  1001e4:	89 44 24 04          	mov    %eax,0x4(%esp)
  1001e8:	c7 04 24 39 61 10 00 	movl   $0x106139,(%esp)
  1001ef:	e8 72 01 00 00       	call   100366 <cprintf>
    round ++;
  1001f4:	a1 00 c0 11 00       	mov    0x11c000,%eax
  1001f9:	40                   	inc    %eax
  1001fa:	a3 00 c0 11 00       	mov    %eax,0x11c000
}
  1001ff:	90                   	nop
  100200:	89 ec                	mov    %ebp,%esp
  100202:	5d                   	pop    %ebp
  100203:	c3                   	ret    

00100204 <lab1_switch_to_user>:

static void
lab1_switch_to_user(void) {
  100204:	55                   	push   %ebp
  100205:	89 e5                	mov    %esp,%ebp
    //LAB1 CHALLENGE 1 : TODO
    asm volatile (
  100207:	83 ec 08             	sub    $0x8,%esp
  10020a:	cd 78                	int    $0x78
  10020c:	89 ec                	mov    %ebp,%esp
	    "int %0 \n"
	    "movl %%ebp, %%esp"
	    : 
	    : "i"(T_SWITCH_TOU)
	);
}
  10020e:	90                   	nop
  10020f:	5d                   	pop    %ebp
  100210:	c3                   	ret    

00100211 <lab1_switch_to_kernel>:

static void
lab1_switch_to_kernel(void) {
  100211:	55                   	push   %ebp
  100212:	89 e5                	mov    %esp,%ebp
    //LAB1 CHALLENGE 1 :  TODO
    asm volatile (
  100214:	cd 79                	int    $0x79
  100216:	89 ec                	mov    %ebp,%esp
	    "int %0 \n"
	    "movl %%ebp, %%esp \n"
	    : 
	    : "i"(T_SWITCH_TOK)
	);
}
  100218:	90                   	nop
  100219:	5d                   	pop    %ebp
  10021a:	c3                   	ret    

0010021b <lab1_switch_test>:

static void
lab1_switch_test(void) {
  10021b:	55                   	push   %ebp
  10021c:	89 e5                	mov    %esp,%ebp
  10021e:	83 ec 18             	sub    $0x18,%esp
    lab1_print_cur_status();
  100221:	e8 1e ff ff ff       	call   100144 <lab1_print_cur_status>
    cprintf("+++ switch to  user  mode +++\n");
  100226:	c7 04 24 48 61 10 00 	movl   $0x106148,(%esp)
  10022d:	e8 34 01 00 00       	call   100366 <cprintf>
    lab1_switch_to_user();
  100232:	e8 cd ff ff ff       	call   100204 <lab1_switch_to_user>
    lab1_print_cur_status();
  100237:	e8 08 ff ff ff       	call   100144 <lab1_print_cur_status>
    cprintf("+++ switch to kernel mode +++\n");
  10023c:	c7 04 24 68 61 10 00 	movl   $0x106168,(%esp)
  100243:	e8 1e 01 00 00       	call   100366 <cprintf>
    lab1_switch_to_kernel();
  100248:	e8 c4 ff ff ff       	call   100211 <lab1_switch_to_kernel>
    lab1_print_cur_status();
  10024d:	e8 f2 fe ff ff       	call   100144 <lab1_print_cur_status>
}
  100252:	90                   	nop
  100253:	89 ec                	mov    %ebp,%esp
  100255:	5d                   	pop    %ebp
  100256:	c3                   	ret    

00100257 <readline>:
 * The readline() function returns the text of the line read. If some errors
 * are happened, NULL is returned. The return value is a global variable,
 * thus it should be copied before it is used.
 * */
char *
readline(const char *prompt) {
  100257:	55                   	push   %ebp
  100258:	89 e5                	mov    %esp,%ebp
  10025a:	83 ec 28             	sub    $0x28,%esp
    if (prompt != NULL) {
  10025d:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
  100261:	74 13                	je     100276 <readline+0x1f>
        cprintf("%s", prompt);
  100263:	8b 45 08             	mov    0x8(%ebp),%eax
  100266:	89 44 24 04          	mov    %eax,0x4(%esp)
  10026a:	c7 04 24 87 61 10 00 	movl   $0x106187,(%esp)
  100271:	e8 f0 00 00 00       	call   100366 <cprintf>
    }
    int i = 0, c;
  100276:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    while (1) {
        c = getchar();
  10027d:	e8 73 01 00 00       	call   1003f5 <getchar>
  100282:	89 45 f0             	mov    %eax,-0x10(%ebp)
        if (c < 0) {
  100285:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
  100289:	79 07                	jns    100292 <readline+0x3b>
            return NULL;
  10028b:	b8 00 00 00 00       	mov    $0x0,%eax
  100290:	eb 78                	jmp    10030a <readline+0xb3>
        }
        else if (c >= ' ' && i < BUFSIZE - 1) {
  100292:	83 7d f0 1f          	cmpl   $0x1f,-0x10(%ebp)
  100296:	7e 28                	jle    1002c0 <readline+0x69>
  100298:	81 7d f4 fe 03 00 00 	cmpl   $0x3fe,-0xc(%ebp)
  10029f:	7f 1f                	jg     1002c0 <readline+0x69>
            cputchar(c);
  1002a1:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1002a4:	89 04 24             	mov    %eax,(%esp)
  1002a7:	e8 e2 00 00 00       	call   10038e <cputchar>
            buf[i ++] = c;
  1002ac:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1002af:	8d 50 01             	lea    0x1(%eax),%edx
  1002b2:	89 55 f4             	mov    %edx,-0xc(%ebp)
  1002b5:	8b 55 f0             	mov    -0x10(%ebp),%edx
  1002b8:	88 90 20 c0 11 00    	mov    %dl,0x11c020(%eax)
  1002be:	eb 45                	jmp    100305 <readline+0xae>
        }
        else if (c == '\b' && i > 0) {
  1002c0:	83 7d f0 08          	cmpl   $0x8,-0x10(%ebp)
  1002c4:	75 16                	jne    1002dc <readline+0x85>
  1002c6:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
  1002ca:	7e 10                	jle    1002dc <readline+0x85>
            cputchar(c);
  1002cc:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1002cf:	89 04 24             	mov    %eax,(%esp)
  1002d2:	e8 b7 00 00 00       	call   10038e <cputchar>
            i --;
  1002d7:	ff 4d f4             	decl   -0xc(%ebp)
  1002da:	eb 29                	jmp    100305 <readline+0xae>
        }
        else if (c == '\n' || c == '\r') {
  1002dc:	83 7d f0 0a          	cmpl   $0xa,-0x10(%ebp)
  1002e0:	74 06                	je     1002e8 <readline+0x91>
  1002e2:	83 7d f0 0d          	cmpl   $0xd,-0x10(%ebp)
  1002e6:	75 95                	jne    10027d <readline+0x26>
            cputchar(c);
  1002e8:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1002eb:	89 04 24             	mov    %eax,(%esp)
  1002ee:	e8 9b 00 00 00       	call   10038e <cputchar>
            buf[i] = '\0';
  1002f3:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1002f6:	05 20 c0 11 00       	add    $0x11c020,%eax
  1002fb:	c6 00 00             	movb   $0x0,(%eax)
            return buf;
  1002fe:	b8 20 c0 11 00       	mov    $0x11c020,%eax
  100303:	eb 05                	jmp    10030a <readline+0xb3>
        c = getchar();
  100305:	e9 73 ff ff ff       	jmp    10027d <readline+0x26>
        }
    }
}
  10030a:	89 ec                	mov    %ebp,%esp
  10030c:	5d                   	pop    %ebp
  10030d:	c3                   	ret    

0010030e <cputch>:
/* *
 * cputch - writes a single character @c to stdout, and it will
 * increace the value of counter pointed by @cnt.
 * */
static void
cputch(int c, int *cnt) {
  10030e:	55                   	push   %ebp
  10030f:	89 e5                	mov    %esp,%ebp
  100311:	83 ec 18             	sub    $0x18,%esp
    cons_putc(c);
  100314:	8b 45 08             	mov    0x8(%ebp),%eax
  100317:	89 04 24             	mov    %eax,(%esp)
  10031a:	e8 b5 12 00 00       	call   1015d4 <cons_putc>
    (*cnt) ++;
  10031f:	8b 45 0c             	mov    0xc(%ebp),%eax
  100322:	8b 00                	mov    (%eax),%eax
  100324:	8d 50 01             	lea    0x1(%eax),%edx
  100327:	8b 45 0c             	mov    0xc(%ebp),%eax
  10032a:	89 10                	mov    %edx,(%eax)
}
  10032c:	90                   	nop
  10032d:	89 ec                	mov    %ebp,%esp
  10032f:	5d                   	pop    %ebp
  100330:	c3                   	ret    

00100331 <vcprintf>:
 *
 * Call this function if you are already dealing with a va_list.
 * Or you probably want cprintf() instead.
 * */
int
vcprintf(const char *fmt, va_list ap) {
  100331:	55                   	push   %ebp
  100332:	89 e5                	mov    %esp,%ebp
  100334:	83 ec 28             	sub    $0x28,%esp
    int cnt = 0;
  100337:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    vprintfmt((void*)cputch, &cnt, fmt, ap);
  10033e:	8b 45 0c             	mov    0xc(%ebp),%eax
  100341:	89 44 24 0c          	mov    %eax,0xc(%esp)
  100345:	8b 45 08             	mov    0x8(%ebp),%eax
  100348:	89 44 24 08          	mov    %eax,0x8(%esp)
  10034c:	8d 45 f4             	lea    -0xc(%ebp),%eax
  10034f:	89 44 24 04          	mov    %eax,0x4(%esp)
  100353:	c7 04 24 0e 03 10 00 	movl   $0x10030e,(%esp)
  10035a:	e8 1a 54 00 00       	call   105779 <vprintfmt>
    return cnt;
  10035f:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
  100362:	89 ec                	mov    %ebp,%esp
  100364:	5d                   	pop    %ebp
  100365:	c3                   	ret    

00100366 <cprintf>:
 *
 * The return value is the number of characters which would be
 * written to stdout.
 * */
int
cprintf(const char *fmt, ...) {
  100366:	55                   	push   %ebp
  100367:	89 e5                	mov    %esp,%ebp
  100369:	83 ec 28             	sub    $0x28,%esp
    va_list ap;
    int cnt;
    va_start(ap, fmt);
  10036c:	8d 45 0c             	lea    0xc(%ebp),%eax
  10036f:	89 45 f0             	mov    %eax,-0x10(%ebp)
    cnt = vcprintf(fmt, ap);
  100372:	8b 45 f0             	mov    -0x10(%ebp),%eax
  100375:	89 44 24 04          	mov    %eax,0x4(%esp)
  100379:	8b 45 08             	mov    0x8(%ebp),%eax
  10037c:	89 04 24             	mov    %eax,(%esp)
  10037f:	e8 ad ff ff ff       	call   100331 <vcprintf>
  100384:	89 45 f4             	mov    %eax,-0xc(%ebp)
    va_end(ap);
    return cnt;
  100387:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
  10038a:	89 ec                	mov    %ebp,%esp
  10038c:	5d                   	pop    %ebp
  10038d:	c3                   	ret    

0010038e <cputchar>:

/* cputchar - writes a single character to stdout */
void
cputchar(int c) {
  10038e:	55                   	push   %ebp
  10038f:	89 e5                	mov    %esp,%ebp
  100391:	83 ec 18             	sub    $0x18,%esp
    cons_putc(c);
  100394:	8b 45 08             	mov    0x8(%ebp),%eax
  100397:	89 04 24             	mov    %eax,(%esp)
  10039a:	e8 35 12 00 00       	call   1015d4 <cons_putc>
}
  10039f:	90                   	nop
  1003a0:	89 ec                	mov    %ebp,%esp
  1003a2:	5d                   	pop    %ebp
  1003a3:	c3                   	ret    

001003a4 <cputs>:
/* *
 * cputs- writes the string pointed by @str to stdout and
 * appends a newline character.
 * */
int
cputs(const char *str) {
  1003a4:	55                   	push   %ebp
  1003a5:	89 e5                	mov    %esp,%ebp
  1003a7:	83 ec 28             	sub    $0x28,%esp
    int cnt = 0;
  1003aa:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
    char c;
    while ((c = *str ++) != '\0') {
  1003b1:	eb 13                	jmp    1003c6 <cputs+0x22>
        cputch(c, &cnt);
  1003b3:	0f be 45 f7          	movsbl -0x9(%ebp),%eax
  1003b7:	8d 55 f0             	lea    -0x10(%ebp),%edx
  1003ba:	89 54 24 04          	mov    %edx,0x4(%esp)
  1003be:	89 04 24             	mov    %eax,(%esp)
  1003c1:	e8 48 ff ff ff       	call   10030e <cputch>
    while ((c = *str ++) != '\0') {
  1003c6:	8b 45 08             	mov    0x8(%ebp),%eax
  1003c9:	8d 50 01             	lea    0x1(%eax),%edx
  1003cc:	89 55 08             	mov    %edx,0x8(%ebp)
  1003cf:	0f b6 00             	movzbl (%eax),%eax
  1003d2:	88 45 f7             	mov    %al,-0x9(%ebp)
  1003d5:	80 7d f7 00          	cmpb   $0x0,-0x9(%ebp)
  1003d9:	75 d8                	jne    1003b3 <cputs+0xf>
    }
    cputch('\n', &cnt);
  1003db:	8d 45 f0             	lea    -0x10(%ebp),%eax
  1003de:	89 44 24 04          	mov    %eax,0x4(%esp)
  1003e2:	c7 04 24 0a 00 00 00 	movl   $0xa,(%esp)
  1003e9:	e8 20 ff ff ff       	call   10030e <cputch>
    return cnt;
  1003ee:	8b 45 f0             	mov    -0x10(%ebp),%eax
}
  1003f1:	89 ec                	mov    %ebp,%esp
  1003f3:	5d                   	pop    %ebp
  1003f4:	c3                   	ret    

001003f5 <getchar>:

/* getchar - reads a single non-zero character from stdin */
int
getchar(void) {
  1003f5:	55                   	push   %ebp
  1003f6:	89 e5                	mov    %esp,%ebp
  1003f8:	83 ec 18             	sub    $0x18,%esp
    int c;
    while ((c = cons_getc()) == 0)
  1003fb:	90                   	nop
  1003fc:	e8 12 12 00 00       	call   101613 <cons_getc>
  100401:	89 45 f4             	mov    %eax,-0xc(%ebp)
  100404:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
  100408:	74 f2                	je     1003fc <getchar+0x7>
        /* do nothing */;
    return c;
  10040a:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
  10040d:	89 ec                	mov    %ebp,%esp
  10040f:	5d                   	pop    %ebp
  100410:	c3                   	ret    

00100411 <stab_binsearch>:
 *      stab_binsearch(stabs, &left, &right, N_SO, 0xf0100184);
 * will exit setting left = 118, right = 554.
 * */
static void
stab_binsearch(const struct stab *stabs, int *region_left, int *region_right,
           int type, uintptr_t addr) {
  100411:	55                   	push   %ebp
  100412:	89 e5                	mov    %esp,%ebp
  100414:	83 ec 20             	sub    $0x20,%esp
    int l = *region_left, r = *region_right, any_matches = 0;
  100417:	8b 45 0c             	mov    0xc(%ebp),%eax
  10041a:	8b 00                	mov    (%eax),%eax
  10041c:	89 45 fc             	mov    %eax,-0x4(%ebp)
  10041f:	8b 45 10             	mov    0x10(%ebp),%eax
  100422:	8b 00                	mov    (%eax),%eax
  100424:	89 45 f8             	mov    %eax,-0x8(%ebp)
  100427:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)

    while (l <= r) {
  10042e:	e9 ca 00 00 00       	jmp    1004fd <stab_binsearch+0xec>
        int true_m = (l + r) / 2, m = true_m;
  100433:	8b 55 fc             	mov    -0x4(%ebp),%edx
  100436:	8b 45 f8             	mov    -0x8(%ebp),%eax
  100439:	01 d0                	add    %edx,%eax
  10043b:	89 c2                	mov    %eax,%edx
  10043d:	c1 ea 1f             	shr    $0x1f,%edx
  100440:	01 d0                	add    %edx,%eax
  100442:	d1 f8                	sar    %eax
  100444:	89 45 ec             	mov    %eax,-0x14(%ebp)
  100447:	8b 45 ec             	mov    -0x14(%ebp),%eax
  10044a:	89 45 f0             	mov    %eax,-0x10(%ebp)

        // search for earliest stab with right type
        while (m >= l && stabs[m].n_type != type) {
  10044d:	eb 03                	jmp    100452 <stab_binsearch+0x41>
            m --;
  10044f:	ff 4d f0             	decl   -0x10(%ebp)
        while (m >= l && stabs[m].n_type != type) {
  100452:	8b 45 f0             	mov    -0x10(%ebp),%eax
  100455:	3b 45 fc             	cmp    -0x4(%ebp),%eax
  100458:	7c 1f                	jl     100479 <stab_binsearch+0x68>
  10045a:	8b 55 f0             	mov    -0x10(%ebp),%edx
  10045d:	89 d0                	mov    %edx,%eax
  10045f:	01 c0                	add    %eax,%eax
  100461:	01 d0                	add    %edx,%eax
  100463:	c1 e0 02             	shl    $0x2,%eax
  100466:	89 c2                	mov    %eax,%edx
  100468:	8b 45 08             	mov    0x8(%ebp),%eax
  10046b:	01 d0                	add    %edx,%eax
  10046d:	0f b6 40 04          	movzbl 0x4(%eax),%eax
  100471:	0f b6 c0             	movzbl %al,%eax
  100474:	39 45 14             	cmp    %eax,0x14(%ebp)
  100477:	75 d6                	jne    10044f <stab_binsearch+0x3e>
        }
        if (m < l) {    // no match in [l, m]
  100479:	8b 45 f0             	mov    -0x10(%ebp),%eax
  10047c:	3b 45 fc             	cmp    -0x4(%ebp),%eax
  10047f:	7d 09                	jge    10048a <stab_binsearch+0x79>
            l = true_m + 1;
  100481:	8b 45 ec             	mov    -0x14(%ebp),%eax
  100484:	40                   	inc    %eax
  100485:	89 45 fc             	mov    %eax,-0x4(%ebp)
            continue;
  100488:	eb 73                	jmp    1004fd <stab_binsearch+0xec>
        }

        // actual binary search
        any_matches = 1;
  10048a:	c7 45 f4 01 00 00 00 	movl   $0x1,-0xc(%ebp)
        if (stabs[m].n_value < addr) {
  100491:	8b 55 f0             	mov    -0x10(%ebp),%edx
  100494:	89 d0                	mov    %edx,%eax
  100496:	01 c0                	add    %eax,%eax
  100498:	01 d0                	add    %edx,%eax
  10049a:	c1 e0 02             	shl    $0x2,%eax
  10049d:	89 c2                	mov    %eax,%edx
  10049f:	8b 45 08             	mov    0x8(%ebp),%eax
  1004a2:	01 d0                	add    %edx,%eax
  1004a4:	8b 40 08             	mov    0x8(%eax),%eax
  1004a7:	39 45 18             	cmp    %eax,0x18(%ebp)
  1004aa:	76 11                	jbe    1004bd <stab_binsearch+0xac>
            *region_left = m;
  1004ac:	8b 45 0c             	mov    0xc(%ebp),%eax
  1004af:	8b 55 f0             	mov    -0x10(%ebp),%edx
  1004b2:	89 10                	mov    %edx,(%eax)
            l = true_m + 1;
  1004b4:	8b 45 ec             	mov    -0x14(%ebp),%eax
  1004b7:	40                   	inc    %eax
  1004b8:	89 45 fc             	mov    %eax,-0x4(%ebp)
  1004bb:	eb 40                	jmp    1004fd <stab_binsearch+0xec>
        } else if (stabs[m].n_value > addr) {
  1004bd:	8b 55 f0             	mov    -0x10(%ebp),%edx
  1004c0:	89 d0                	mov    %edx,%eax
  1004c2:	01 c0                	add    %eax,%eax
  1004c4:	01 d0                	add    %edx,%eax
  1004c6:	c1 e0 02             	shl    $0x2,%eax
  1004c9:	89 c2                	mov    %eax,%edx
  1004cb:	8b 45 08             	mov    0x8(%ebp),%eax
  1004ce:	01 d0                	add    %edx,%eax
  1004d0:	8b 40 08             	mov    0x8(%eax),%eax
  1004d3:	39 45 18             	cmp    %eax,0x18(%ebp)
  1004d6:	73 14                	jae    1004ec <stab_binsearch+0xdb>
            *region_right = m - 1;
  1004d8:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1004db:	8d 50 ff             	lea    -0x1(%eax),%edx
  1004de:	8b 45 10             	mov    0x10(%ebp),%eax
  1004e1:	89 10                	mov    %edx,(%eax)
            r = m - 1;
  1004e3:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1004e6:	48                   	dec    %eax
  1004e7:	89 45 f8             	mov    %eax,-0x8(%ebp)
  1004ea:	eb 11                	jmp    1004fd <stab_binsearch+0xec>
        } else {
            // exact match for 'addr', but continue loop to find
            // *region_right
            *region_left = m;
  1004ec:	8b 45 0c             	mov    0xc(%ebp),%eax
  1004ef:	8b 55 f0             	mov    -0x10(%ebp),%edx
  1004f2:	89 10                	mov    %edx,(%eax)
            l = m;
  1004f4:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1004f7:	89 45 fc             	mov    %eax,-0x4(%ebp)
            addr ++;
  1004fa:	ff 45 18             	incl   0x18(%ebp)
    while (l <= r) {
  1004fd:	8b 45 fc             	mov    -0x4(%ebp),%eax
  100500:	3b 45 f8             	cmp    -0x8(%ebp),%eax
  100503:	0f 8e 2a ff ff ff    	jle    100433 <stab_binsearch+0x22>
        }
    }

    if (!any_matches) {
  100509:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
  10050d:	75 0f                	jne    10051e <stab_binsearch+0x10d>
        *region_right = *region_left - 1;
  10050f:	8b 45 0c             	mov    0xc(%ebp),%eax
  100512:	8b 00                	mov    (%eax),%eax
  100514:	8d 50 ff             	lea    -0x1(%eax),%edx
  100517:	8b 45 10             	mov    0x10(%ebp),%eax
  10051a:	89 10                	mov    %edx,(%eax)
        l = *region_right;
        for (; l > *region_left && stabs[l].n_type != type; l --)
            /* do nothing */;
        *region_left = l;
    }
}
  10051c:	eb 3e                	jmp    10055c <stab_binsearch+0x14b>
        l = *region_right;
  10051e:	8b 45 10             	mov    0x10(%ebp),%eax
  100521:	8b 00                	mov    (%eax),%eax
  100523:	89 45 fc             	mov    %eax,-0x4(%ebp)
        for (; l > *region_left && stabs[l].n_type != type; l --)
  100526:	eb 03                	jmp    10052b <stab_binsearch+0x11a>
  100528:	ff 4d fc             	decl   -0x4(%ebp)
  10052b:	8b 45 0c             	mov    0xc(%ebp),%eax
  10052e:	8b 00                	mov    (%eax),%eax
  100530:	39 45 fc             	cmp    %eax,-0x4(%ebp)
  100533:	7e 1f                	jle    100554 <stab_binsearch+0x143>
  100535:	8b 55 fc             	mov    -0x4(%ebp),%edx
  100538:	89 d0                	mov    %edx,%eax
  10053a:	01 c0                	add    %eax,%eax
  10053c:	01 d0                	add    %edx,%eax
  10053e:	c1 e0 02             	shl    $0x2,%eax
  100541:	89 c2                	mov    %eax,%edx
  100543:	8b 45 08             	mov    0x8(%ebp),%eax
  100546:	01 d0                	add    %edx,%eax
  100548:	0f b6 40 04          	movzbl 0x4(%eax),%eax
  10054c:	0f b6 c0             	movzbl %al,%eax
  10054f:	39 45 14             	cmp    %eax,0x14(%ebp)
  100552:	75 d4                	jne    100528 <stab_binsearch+0x117>
        *region_left = l;
  100554:	8b 45 0c             	mov    0xc(%ebp),%eax
  100557:	8b 55 fc             	mov    -0x4(%ebp),%edx
  10055a:	89 10                	mov    %edx,(%eax)
}
  10055c:	90                   	nop
  10055d:	89 ec                	mov    %ebp,%esp
  10055f:	5d                   	pop    %ebp
  100560:	c3                   	ret    

00100561 <debuginfo_eip>:
 * the specified instruction address, @addr.  Returns 0 if information
 * was found, and negative if not.  But even if it returns negative it
 * has stored some information into '*info'.
 * */
int
debuginfo_eip(uintptr_t addr, struct eipdebuginfo *info) {
  100561:	55                   	push   %ebp
  100562:	89 e5                	mov    %esp,%ebp
  100564:	83 ec 58             	sub    $0x58,%esp
    const struct stab *stabs, *stab_end;
    const char *stabstr, *stabstr_end;

    info->eip_file = "<unknown>";
  100567:	8b 45 0c             	mov    0xc(%ebp),%eax
  10056a:	c7 00 8c 61 10 00    	movl   $0x10618c,(%eax)
    info->eip_line = 0;
  100570:	8b 45 0c             	mov    0xc(%ebp),%eax
  100573:	c7 40 04 00 00 00 00 	movl   $0x0,0x4(%eax)
    info->eip_fn_name = "<unknown>";
  10057a:	8b 45 0c             	mov    0xc(%ebp),%eax
  10057d:	c7 40 08 8c 61 10 00 	movl   $0x10618c,0x8(%eax)
    info->eip_fn_namelen = 9;
  100584:	8b 45 0c             	mov    0xc(%ebp),%eax
  100587:	c7 40 0c 09 00 00 00 	movl   $0x9,0xc(%eax)
    info->eip_fn_addr = addr;
  10058e:	8b 45 0c             	mov    0xc(%ebp),%eax
  100591:	8b 55 08             	mov    0x8(%ebp),%edx
  100594:	89 50 10             	mov    %edx,0x10(%eax)
    info->eip_fn_narg = 0;
  100597:	8b 45 0c             	mov    0xc(%ebp),%eax
  10059a:	c7 40 14 00 00 00 00 	movl   $0x0,0x14(%eax)

    stabs = __STAB_BEGIN__;
  1005a1:	c7 45 f4 e0 73 10 00 	movl   $0x1073e0,-0xc(%ebp)
    stab_end = __STAB_END__;
  1005a8:	c7 45 f0 94 2b 11 00 	movl   $0x112b94,-0x10(%ebp)
    stabstr = __STABSTR_BEGIN__;
  1005af:	c7 45 ec 95 2b 11 00 	movl   $0x112b95,-0x14(%ebp)
    stabstr_end = __STABSTR_END__;
  1005b6:	c7 45 e8 2c 61 11 00 	movl   $0x11612c,-0x18(%ebp)

    // String table validity checks
    if (stabstr_end <= stabstr || stabstr_end[-1] != 0) {
  1005bd:	8b 45 e8             	mov    -0x18(%ebp),%eax
  1005c0:	3b 45 ec             	cmp    -0x14(%ebp),%eax
  1005c3:	76 0b                	jbe    1005d0 <debuginfo_eip+0x6f>
  1005c5:	8b 45 e8             	mov    -0x18(%ebp),%eax
  1005c8:	48                   	dec    %eax
  1005c9:	0f b6 00             	movzbl (%eax),%eax
  1005cc:	84 c0                	test   %al,%al
  1005ce:	74 0a                	je     1005da <debuginfo_eip+0x79>
        return -1;
  1005d0:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
  1005d5:	e9 ab 02 00 00       	jmp    100885 <debuginfo_eip+0x324>
    // 'eip'.  First, we find the basic source file containing 'eip'.
    // Then, we look in that source file for the function.  Then we look
    // for the line number.

    // Search the entire set of stabs for the source file (type N_SO).
    int lfile = 0, rfile = (stab_end - stabs) - 1;
  1005da:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
  1005e1:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1005e4:	2b 45 f4             	sub    -0xc(%ebp),%eax
  1005e7:	c1 f8 02             	sar    $0x2,%eax
  1005ea:	69 c0 ab aa aa aa    	imul   $0xaaaaaaab,%eax,%eax
  1005f0:	48                   	dec    %eax
  1005f1:	89 45 e0             	mov    %eax,-0x20(%ebp)
    stab_binsearch(stabs, &lfile, &rfile, N_SO, addr);
  1005f4:	8b 45 08             	mov    0x8(%ebp),%eax
  1005f7:	89 44 24 10          	mov    %eax,0x10(%esp)
  1005fb:	c7 44 24 0c 64 00 00 	movl   $0x64,0xc(%esp)
  100602:	00 
  100603:	8d 45 e0             	lea    -0x20(%ebp),%eax
  100606:	89 44 24 08          	mov    %eax,0x8(%esp)
  10060a:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  10060d:	89 44 24 04          	mov    %eax,0x4(%esp)
  100611:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100614:	89 04 24             	mov    %eax,(%esp)
  100617:	e8 f5 fd ff ff       	call   100411 <stab_binsearch>
    if (lfile == 0)
  10061c:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  10061f:	85 c0                	test   %eax,%eax
  100621:	75 0a                	jne    10062d <debuginfo_eip+0xcc>
        return -1;
  100623:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
  100628:	e9 58 02 00 00       	jmp    100885 <debuginfo_eip+0x324>

    // Search within that file's stabs for the function definition
    // (N_FUN).
    int lfun = lfile, rfun = rfile;
  10062d:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  100630:	89 45 dc             	mov    %eax,-0x24(%ebp)
  100633:	8b 45 e0             	mov    -0x20(%ebp),%eax
  100636:	89 45 d8             	mov    %eax,-0x28(%ebp)
    int lline, rline;
    stab_binsearch(stabs, &lfun, &rfun, N_FUN, addr);
  100639:	8b 45 08             	mov    0x8(%ebp),%eax
  10063c:	89 44 24 10          	mov    %eax,0x10(%esp)
  100640:	c7 44 24 0c 24 00 00 	movl   $0x24,0xc(%esp)
  100647:	00 
  100648:	8d 45 d8             	lea    -0x28(%ebp),%eax
  10064b:	89 44 24 08          	mov    %eax,0x8(%esp)
  10064f:	8d 45 dc             	lea    -0x24(%ebp),%eax
  100652:	89 44 24 04          	mov    %eax,0x4(%esp)
  100656:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100659:	89 04 24             	mov    %eax,(%esp)
  10065c:	e8 b0 fd ff ff       	call   100411 <stab_binsearch>

    if (lfun <= rfun) {
  100661:	8b 55 dc             	mov    -0x24(%ebp),%edx
  100664:	8b 45 d8             	mov    -0x28(%ebp),%eax
  100667:	39 c2                	cmp    %eax,%edx
  100669:	7f 78                	jg     1006e3 <debuginfo_eip+0x182>
        // stabs[lfun] points to the function name
        // in the string table, but check bounds just in case.
        if (stabs[lfun].n_strx < stabstr_end - stabstr) {
  10066b:	8b 45 dc             	mov    -0x24(%ebp),%eax
  10066e:	89 c2                	mov    %eax,%edx
  100670:	89 d0                	mov    %edx,%eax
  100672:	01 c0                	add    %eax,%eax
  100674:	01 d0                	add    %edx,%eax
  100676:	c1 e0 02             	shl    $0x2,%eax
  100679:	89 c2                	mov    %eax,%edx
  10067b:	8b 45 f4             	mov    -0xc(%ebp),%eax
  10067e:	01 d0                	add    %edx,%eax
  100680:	8b 10                	mov    (%eax),%edx
  100682:	8b 45 e8             	mov    -0x18(%ebp),%eax
  100685:	2b 45 ec             	sub    -0x14(%ebp),%eax
  100688:	39 c2                	cmp    %eax,%edx
  10068a:	73 22                	jae    1006ae <debuginfo_eip+0x14d>
            info->eip_fn_name = stabstr + stabs[lfun].n_strx;
  10068c:	8b 45 dc             	mov    -0x24(%ebp),%eax
  10068f:	89 c2                	mov    %eax,%edx
  100691:	89 d0                	mov    %edx,%eax
  100693:	01 c0                	add    %eax,%eax
  100695:	01 d0                	add    %edx,%eax
  100697:	c1 e0 02             	shl    $0x2,%eax
  10069a:	89 c2                	mov    %eax,%edx
  10069c:	8b 45 f4             	mov    -0xc(%ebp),%eax
  10069f:	01 d0                	add    %edx,%eax
  1006a1:	8b 10                	mov    (%eax),%edx
  1006a3:	8b 45 ec             	mov    -0x14(%ebp),%eax
  1006a6:	01 c2                	add    %eax,%edx
  1006a8:	8b 45 0c             	mov    0xc(%ebp),%eax
  1006ab:	89 50 08             	mov    %edx,0x8(%eax)
        }
        info->eip_fn_addr = stabs[lfun].n_value;
  1006ae:	8b 45 dc             	mov    -0x24(%ebp),%eax
  1006b1:	89 c2                	mov    %eax,%edx
  1006b3:	89 d0                	mov    %edx,%eax
  1006b5:	01 c0                	add    %eax,%eax
  1006b7:	01 d0                	add    %edx,%eax
  1006b9:	c1 e0 02             	shl    $0x2,%eax
  1006bc:	89 c2                	mov    %eax,%edx
  1006be:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1006c1:	01 d0                	add    %edx,%eax
  1006c3:	8b 50 08             	mov    0x8(%eax),%edx
  1006c6:	8b 45 0c             	mov    0xc(%ebp),%eax
  1006c9:	89 50 10             	mov    %edx,0x10(%eax)
        addr -= info->eip_fn_addr;
  1006cc:	8b 45 0c             	mov    0xc(%ebp),%eax
  1006cf:	8b 40 10             	mov    0x10(%eax),%eax
  1006d2:	29 45 08             	sub    %eax,0x8(%ebp)
        // Search within the function definition for the line number.
        lline = lfun;
  1006d5:	8b 45 dc             	mov    -0x24(%ebp),%eax
  1006d8:	89 45 d4             	mov    %eax,-0x2c(%ebp)
        rline = rfun;
  1006db:	8b 45 d8             	mov    -0x28(%ebp),%eax
  1006de:	89 45 d0             	mov    %eax,-0x30(%ebp)
  1006e1:	eb 15                	jmp    1006f8 <debuginfo_eip+0x197>
    } else {
        // Couldn't find function stab!  Maybe we're in an assembly
        // file.  Search the whole file for the line number.
        info->eip_fn_addr = addr;
  1006e3:	8b 45 0c             	mov    0xc(%ebp),%eax
  1006e6:	8b 55 08             	mov    0x8(%ebp),%edx
  1006e9:	89 50 10             	mov    %edx,0x10(%eax)
        lline = lfile;
  1006ec:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  1006ef:	89 45 d4             	mov    %eax,-0x2c(%ebp)
        rline = rfile;
  1006f2:	8b 45 e0             	mov    -0x20(%ebp),%eax
  1006f5:	89 45 d0             	mov    %eax,-0x30(%ebp)
    }
    info->eip_fn_namelen = strfind(info->eip_fn_name, ':') - info->eip_fn_name;
  1006f8:	8b 45 0c             	mov    0xc(%ebp),%eax
  1006fb:	8b 40 08             	mov    0x8(%eax),%eax
  1006fe:	c7 44 24 04 3a 00 00 	movl   $0x3a,0x4(%esp)
  100705:	00 
  100706:	89 04 24             	mov    %eax,(%esp)
  100709:	e8 b8 56 00 00       	call   105dc6 <strfind>
  10070e:	8b 55 0c             	mov    0xc(%ebp),%edx
  100711:	8b 4a 08             	mov    0x8(%edx),%ecx
  100714:	29 c8                	sub    %ecx,%eax
  100716:	89 c2                	mov    %eax,%edx
  100718:	8b 45 0c             	mov    0xc(%ebp),%eax
  10071b:	89 50 0c             	mov    %edx,0xc(%eax)

    // Search within [lline, rline] for the line number stab.
    // If found, set info->eip_line to the right line number.
    // If not found, return -1.
    stab_binsearch(stabs, &lline, &rline, N_SLINE, addr);
  10071e:	8b 45 08             	mov    0x8(%ebp),%eax
  100721:	89 44 24 10          	mov    %eax,0x10(%esp)
  100725:	c7 44 24 0c 44 00 00 	movl   $0x44,0xc(%esp)
  10072c:	00 
  10072d:	8d 45 d0             	lea    -0x30(%ebp),%eax
  100730:	89 44 24 08          	mov    %eax,0x8(%esp)
  100734:	8d 45 d4             	lea    -0x2c(%ebp),%eax
  100737:	89 44 24 04          	mov    %eax,0x4(%esp)
  10073b:	8b 45 f4             	mov    -0xc(%ebp),%eax
  10073e:	89 04 24             	mov    %eax,(%esp)
  100741:	e8 cb fc ff ff       	call   100411 <stab_binsearch>
    if (lline <= rline) {
  100746:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  100749:	8b 45 d0             	mov    -0x30(%ebp),%eax
  10074c:	39 c2                	cmp    %eax,%edx
  10074e:	7f 23                	jg     100773 <debuginfo_eip+0x212>
        info->eip_line = stabs[rline].n_desc;
  100750:	8b 45 d0             	mov    -0x30(%ebp),%eax
  100753:	89 c2                	mov    %eax,%edx
  100755:	89 d0                	mov    %edx,%eax
  100757:	01 c0                	add    %eax,%eax
  100759:	01 d0                	add    %edx,%eax
  10075b:	c1 e0 02             	shl    $0x2,%eax
  10075e:	89 c2                	mov    %eax,%edx
  100760:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100763:	01 d0                	add    %edx,%eax
  100765:	0f b7 40 06          	movzwl 0x6(%eax),%eax
  100769:	89 c2                	mov    %eax,%edx
  10076b:	8b 45 0c             	mov    0xc(%ebp),%eax
  10076e:	89 50 04             	mov    %edx,0x4(%eax)

    // Search backwards from the line number for the relevant filename stab.
    // We can't just use the "lfile" stab because inlined functions
    // can interpolate code from a different file!
    // Such included source files use the N_SOL stab type.
    while (lline >= lfile
  100771:	eb 11                	jmp    100784 <debuginfo_eip+0x223>
        return -1;
  100773:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
  100778:	e9 08 01 00 00       	jmp    100885 <debuginfo_eip+0x324>
           && stabs[lline].n_type != N_SOL
           && (stabs[lline].n_type != N_SO || !stabs[lline].n_value)) {
        lline --;
  10077d:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  100780:	48                   	dec    %eax
  100781:	89 45 d4             	mov    %eax,-0x2c(%ebp)
    while (lline >= lfile
  100784:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  100787:	8b 45 e4             	mov    -0x1c(%ebp),%eax
           && (stabs[lline].n_type != N_SO || !stabs[lline].n_value)) {
  10078a:	39 c2                	cmp    %eax,%edx
  10078c:	7c 56                	jl     1007e4 <debuginfo_eip+0x283>
           && stabs[lline].n_type != N_SOL
  10078e:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  100791:	89 c2                	mov    %eax,%edx
  100793:	89 d0                	mov    %edx,%eax
  100795:	01 c0                	add    %eax,%eax
  100797:	01 d0                	add    %edx,%eax
  100799:	c1 e0 02             	shl    $0x2,%eax
  10079c:	89 c2                	mov    %eax,%edx
  10079e:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1007a1:	01 d0                	add    %edx,%eax
  1007a3:	0f b6 40 04          	movzbl 0x4(%eax),%eax
  1007a7:	3c 84                	cmp    $0x84,%al
  1007a9:	74 39                	je     1007e4 <debuginfo_eip+0x283>
           && (stabs[lline].n_type != N_SO || !stabs[lline].n_value)) {
  1007ab:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  1007ae:	89 c2                	mov    %eax,%edx
  1007b0:	89 d0                	mov    %edx,%eax
  1007b2:	01 c0                	add    %eax,%eax
  1007b4:	01 d0                	add    %edx,%eax
  1007b6:	c1 e0 02             	shl    $0x2,%eax
  1007b9:	89 c2                	mov    %eax,%edx
  1007bb:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1007be:	01 d0                	add    %edx,%eax
  1007c0:	0f b6 40 04          	movzbl 0x4(%eax),%eax
  1007c4:	3c 64                	cmp    $0x64,%al
  1007c6:	75 b5                	jne    10077d <debuginfo_eip+0x21c>
  1007c8:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  1007cb:	89 c2                	mov    %eax,%edx
  1007cd:	89 d0                	mov    %edx,%eax
  1007cf:	01 c0                	add    %eax,%eax
  1007d1:	01 d0                	add    %edx,%eax
  1007d3:	c1 e0 02             	shl    $0x2,%eax
  1007d6:	89 c2                	mov    %eax,%edx
  1007d8:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1007db:	01 d0                	add    %edx,%eax
  1007dd:	8b 40 08             	mov    0x8(%eax),%eax
  1007e0:	85 c0                	test   %eax,%eax
  1007e2:	74 99                	je     10077d <debuginfo_eip+0x21c>
    }
    if (lline >= lfile && stabs[lline].n_strx < stabstr_end - stabstr) {
  1007e4:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  1007e7:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  1007ea:	39 c2                	cmp    %eax,%edx
  1007ec:	7c 42                	jl     100830 <debuginfo_eip+0x2cf>
  1007ee:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  1007f1:	89 c2                	mov    %eax,%edx
  1007f3:	89 d0                	mov    %edx,%eax
  1007f5:	01 c0                	add    %eax,%eax
  1007f7:	01 d0                	add    %edx,%eax
  1007f9:	c1 e0 02             	shl    $0x2,%eax
  1007fc:	89 c2                	mov    %eax,%edx
  1007fe:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100801:	01 d0                	add    %edx,%eax
  100803:	8b 10                	mov    (%eax),%edx
  100805:	8b 45 e8             	mov    -0x18(%ebp),%eax
  100808:	2b 45 ec             	sub    -0x14(%ebp),%eax
  10080b:	39 c2                	cmp    %eax,%edx
  10080d:	73 21                	jae    100830 <debuginfo_eip+0x2cf>
        info->eip_file = stabstr + stabs[lline].n_strx;
  10080f:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  100812:	89 c2                	mov    %eax,%edx
  100814:	89 d0                	mov    %edx,%eax
  100816:	01 c0                	add    %eax,%eax
  100818:	01 d0                	add    %edx,%eax
  10081a:	c1 e0 02             	shl    $0x2,%eax
  10081d:	89 c2                	mov    %eax,%edx
  10081f:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100822:	01 d0                	add    %edx,%eax
  100824:	8b 10                	mov    (%eax),%edx
  100826:	8b 45 ec             	mov    -0x14(%ebp),%eax
  100829:	01 c2                	add    %eax,%edx
  10082b:	8b 45 0c             	mov    0xc(%ebp),%eax
  10082e:	89 10                	mov    %edx,(%eax)
    }

    // Set eip_fn_narg to the number of arguments taken by the function,
    // or 0 if there was no containing function.
    if (lfun < rfun) {
  100830:	8b 55 dc             	mov    -0x24(%ebp),%edx
  100833:	8b 45 d8             	mov    -0x28(%ebp),%eax
  100836:	39 c2                	cmp    %eax,%edx
  100838:	7d 46                	jge    100880 <debuginfo_eip+0x31f>
        for (lline = lfun + 1;
  10083a:	8b 45 dc             	mov    -0x24(%ebp),%eax
  10083d:	40                   	inc    %eax
  10083e:	89 45 d4             	mov    %eax,-0x2c(%ebp)
  100841:	eb 16                	jmp    100859 <debuginfo_eip+0x2f8>
             lline < rfun && stabs[lline].n_type == N_PSYM;
             lline ++) {
            info->eip_fn_narg ++;
  100843:	8b 45 0c             	mov    0xc(%ebp),%eax
  100846:	8b 40 14             	mov    0x14(%eax),%eax
  100849:	8d 50 01             	lea    0x1(%eax),%edx
  10084c:	8b 45 0c             	mov    0xc(%ebp),%eax
  10084f:	89 50 14             	mov    %edx,0x14(%eax)
             lline ++) {
  100852:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  100855:	40                   	inc    %eax
  100856:	89 45 d4             	mov    %eax,-0x2c(%ebp)
             lline < rfun && stabs[lline].n_type == N_PSYM;
  100859:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  10085c:	8b 45 d8             	mov    -0x28(%ebp),%eax
  10085f:	39 c2                	cmp    %eax,%edx
  100861:	7d 1d                	jge    100880 <debuginfo_eip+0x31f>
  100863:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  100866:	89 c2                	mov    %eax,%edx
  100868:	89 d0                	mov    %edx,%eax
  10086a:	01 c0                	add    %eax,%eax
  10086c:	01 d0                	add    %edx,%eax
  10086e:	c1 e0 02             	shl    $0x2,%eax
  100871:	89 c2                	mov    %eax,%edx
  100873:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100876:	01 d0                	add    %edx,%eax
  100878:	0f b6 40 04          	movzbl 0x4(%eax),%eax
  10087c:	3c a0                	cmp    $0xa0,%al
  10087e:	74 c3                	je     100843 <debuginfo_eip+0x2e2>
        }
    }
    return 0;
  100880:	b8 00 00 00 00       	mov    $0x0,%eax
}
  100885:	89 ec                	mov    %ebp,%esp
  100887:	5d                   	pop    %ebp
  100888:	c3                   	ret    

00100889 <print_kerninfo>:
 * print_kerninfo - print the information about kernel, including the location
 * of kernel entry, the start addresses of data and text segements, the start
 * address of free memory and how many memory that kernel has used.
 * */
void
print_kerninfo(void) {
  100889:	55                   	push   %ebp
  10088a:	89 e5                	mov    %esp,%ebp
  10088c:	83 ec 18             	sub    $0x18,%esp
    extern char etext[], edata[], end[], kern_init[];
    cprintf("Special kernel symbols:\n");
  10088f:	c7 04 24 96 61 10 00 	movl   $0x106196,(%esp)
  100896:	e8 cb fa ff ff       	call   100366 <cprintf>
    cprintf("  entry  0x%08x (phys)\n", kern_init);
  10089b:	c7 44 24 04 36 00 10 	movl   $0x100036,0x4(%esp)
  1008a2:	00 
  1008a3:	c7 04 24 af 61 10 00 	movl   $0x1061af,(%esp)
  1008aa:	e8 b7 fa ff ff       	call   100366 <cprintf>
    cprintf("  etext  0x%08x (phys)\n", etext);
  1008af:	c7 44 24 04 da 60 10 	movl   $0x1060da,0x4(%esp)
  1008b6:	00 
  1008b7:	c7 04 24 c7 61 10 00 	movl   $0x1061c7,(%esp)
  1008be:	e8 a3 fa ff ff       	call   100366 <cprintf>
    cprintf("  edata  0x%08x (phys)\n", edata);
  1008c3:	c7 44 24 04 36 9a 11 	movl   $0x119a36,0x4(%esp)
  1008ca:	00 
  1008cb:	c7 04 24 df 61 10 00 	movl   $0x1061df,(%esp)
  1008d2:	e8 8f fa ff ff       	call   100366 <cprintf>
    cprintf("  end    0x%08x (phys)\n", end);
  1008d7:	c7 44 24 04 8c cf 11 	movl   $0x11cf8c,0x4(%esp)
  1008de:	00 
  1008df:	c7 04 24 f7 61 10 00 	movl   $0x1061f7,(%esp)
  1008e6:	e8 7b fa ff ff       	call   100366 <cprintf>
    cprintf("Kernel executable memory footprint: %dKB\n", (end - kern_init + 1023)/1024);
  1008eb:	b8 8c cf 11 00       	mov    $0x11cf8c,%eax
  1008f0:	2d 36 00 10 00       	sub    $0x100036,%eax
  1008f5:	05 ff 03 00 00       	add    $0x3ff,%eax
  1008fa:	8d 90 ff 03 00 00    	lea    0x3ff(%eax),%edx
  100900:	85 c0                	test   %eax,%eax
  100902:	0f 48 c2             	cmovs  %edx,%eax
  100905:	c1 f8 0a             	sar    $0xa,%eax
  100908:	89 44 24 04          	mov    %eax,0x4(%esp)
  10090c:	c7 04 24 10 62 10 00 	movl   $0x106210,(%esp)
  100913:	e8 4e fa ff ff       	call   100366 <cprintf>
}
  100918:	90                   	nop
  100919:	89 ec                	mov    %ebp,%esp
  10091b:	5d                   	pop    %ebp
  10091c:	c3                   	ret    

0010091d <print_debuginfo>:
/* *
 * print_debuginfo - read and print the stat information for the address @eip,
 * and info.eip_fn_addr should be the first address of the related function.
 * */
void
print_debuginfo(uintptr_t eip) {
  10091d:	55                   	push   %ebp
  10091e:	89 e5                	mov    %esp,%ebp
  100920:	81 ec 48 01 00 00    	sub    $0x148,%esp
    struct eipdebuginfo info;
    if (debuginfo_eip(eip, &info) != 0) {
  100926:	8d 45 dc             	lea    -0x24(%ebp),%eax
  100929:	89 44 24 04          	mov    %eax,0x4(%esp)
  10092d:	8b 45 08             	mov    0x8(%ebp),%eax
  100930:	89 04 24             	mov    %eax,(%esp)
  100933:	e8 29 fc ff ff       	call   100561 <debuginfo_eip>
  100938:	85 c0                	test   %eax,%eax
  10093a:	74 15                	je     100951 <print_debuginfo+0x34>
        cprintf("    <unknow>: -- 0x%08x --\n", eip);
  10093c:	8b 45 08             	mov    0x8(%ebp),%eax
  10093f:	89 44 24 04          	mov    %eax,0x4(%esp)
  100943:	c7 04 24 3a 62 10 00 	movl   $0x10623a,(%esp)
  10094a:	e8 17 fa ff ff       	call   100366 <cprintf>
        }
        fnname[j] = '\0';
        cprintf("    %s:%d: %s+%d\n", info.eip_file, info.eip_line,
                fnname, eip - info.eip_fn_addr);
    }
}
  10094f:	eb 6c                	jmp    1009bd <print_debuginfo+0xa0>
        for (j = 0; j < info.eip_fn_namelen; j ++) {
  100951:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
  100958:	eb 1b                	jmp    100975 <print_debuginfo+0x58>
            fnname[j] = info.eip_fn_name[j];
  10095a:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  10095d:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100960:	01 d0                	add    %edx,%eax
  100962:	0f b6 10             	movzbl (%eax),%edx
  100965:	8d 8d dc fe ff ff    	lea    -0x124(%ebp),%ecx
  10096b:	8b 45 f4             	mov    -0xc(%ebp),%eax
  10096e:	01 c8                	add    %ecx,%eax
  100970:	88 10                	mov    %dl,(%eax)
        for (j = 0; j < info.eip_fn_namelen; j ++) {
  100972:	ff 45 f4             	incl   -0xc(%ebp)
  100975:	8b 45 e8             	mov    -0x18(%ebp),%eax
  100978:	39 45 f4             	cmp    %eax,-0xc(%ebp)
  10097b:	7c dd                	jl     10095a <print_debuginfo+0x3d>
        fnname[j] = '\0';
  10097d:	8d 95 dc fe ff ff    	lea    -0x124(%ebp),%edx
  100983:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100986:	01 d0                	add    %edx,%eax
  100988:	c6 00 00             	movb   $0x0,(%eax)
                fnname, eip - info.eip_fn_addr);
  10098b:	8b 55 ec             	mov    -0x14(%ebp),%edx
        cprintf("    %s:%d: %s+%d\n", info.eip_file, info.eip_line,
  10098e:	8b 45 08             	mov    0x8(%ebp),%eax
  100991:	29 d0                	sub    %edx,%eax
  100993:	89 c1                	mov    %eax,%ecx
  100995:	8b 55 e0             	mov    -0x20(%ebp),%edx
  100998:	8b 45 dc             	mov    -0x24(%ebp),%eax
  10099b:	89 4c 24 10          	mov    %ecx,0x10(%esp)
  10099f:	8d 8d dc fe ff ff    	lea    -0x124(%ebp),%ecx
  1009a5:	89 4c 24 0c          	mov    %ecx,0xc(%esp)
  1009a9:	89 54 24 08          	mov    %edx,0x8(%esp)
  1009ad:	89 44 24 04          	mov    %eax,0x4(%esp)
  1009b1:	c7 04 24 56 62 10 00 	movl   $0x106256,(%esp)
  1009b8:	e8 a9 f9 ff ff       	call   100366 <cprintf>
}
  1009bd:	90                   	nop
  1009be:	89 ec                	mov    %ebp,%esp
  1009c0:	5d                   	pop    %ebp
  1009c1:	c3                   	ret    

001009c2 <read_eip>:

static __noinline uint32_t
read_eip(void) {
  1009c2:	55                   	push   %ebp
  1009c3:	89 e5                	mov    %esp,%ebp
  1009c5:	83 ec 10             	sub    $0x10,%esp
    uint32_t eip;
    asm volatile("movl 4(%%ebp), %0" : "=r" (eip));
  1009c8:	8b 45 04             	mov    0x4(%ebp),%eax
  1009cb:	89 45 fc             	mov    %eax,-0x4(%ebp)
    return eip;
  1009ce:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
  1009d1:	89 ec                	mov    %ebp,%esp
  1009d3:	5d                   	pop    %ebp
  1009d4:	c3                   	ret    

001009d5 <print_stackframe>:
 *
 * Note that, the length of ebp-chain is limited. In boot/bootasm.S, before jumping
 * to the kernel entry, the value of ebp has been set to zero, that's the boundary.
 * */
void
print_stackframe(void) {
  1009d5:	55                   	push   %ebp
  1009d6:	89 e5                	mov    %esp,%ebp
      *    (3.4) call print_debuginfo(eip-1) to print the C calling function name and line number, etc.
      *    (3.5) popup a calling stackframe
      *           NOTICE: the calling funciton's return addr eip  = ss:[ebp+4]
      *                   the calling funciton's ebp = ss:[ebp]
      */
}
  1009d8:	90                   	nop
  1009d9:	5d                   	pop    %ebp
  1009da:	c3                   	ret    

001009db <parse>:
#define MAXARGS         16
#define WHITESPACE      " \t\n\r"

/* parse - parse the command buffer into whitespace-separated arguments */
static int
parse(char *buf, char **argv) {
  1009db:	55                   	push   %ebp
  1009dc:	89 e5                	mov    %esp,%ebp
  1009de:	83 ec 28             	sub    $0x28,%esp
    int argc = 0;
  1009e1:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    while (1) {
        // find global whitespace
        while (*buf != '\0' && strchr(WHITESPACE, *buf) != NULL) {
  1009e8:	eb 0c                	jmp    1009f6 <parse+0x1b>
            *buf ++ = '\0';
  1009ea:	8b 45 08             	mov    0x8(%ebp),%eax
  1009ed:	8d 50 01             	lea    0x1(%eax),%edx
  1009f0:	89 55 08             	mov    %edx,0x8(%ebp)
  1009f3:	c6 00 00             	movb   $0x0,(%eax)
        while (*buf != '\0' && strchr(WHITESPACE, *buf) != NULL) {
  1009f6:	8b 45 08             	mov    0x8(%ebp),%eax
  1009f9:	0f b6 00             	movzbl (%eax),%eax
  1009fc:	84 c0                	test   %al,%al
  1009fe:	74 1d                	je     100a1d <parse+0x42>
  100a00:	8b 45 08             	mov    0x8(%ebp),%eax
  100a03:	0f b6 00             	movzbl (%eax),%eax
  100a06:	0f be c0             	movsbl %al,%eax
  100a09:	89 44 24 04          	mov    %eax,0x4(%esp)
  100a0d:	c7 04 24 e8 62 10 00 	movl   $0x1062e8,(%esp)
  100a14:	e8 79 53 00 00       	call   105d92 <strchr>
  100a19:	85 c0                	test   %eax,%eax
  100a1b:	75 cd                	jne    1009ea <parse+0xf>
        }
        if (*buf == '\0') {
  100a1d:	8b 45 08             	mov    0x8(%ebp),%eax
  100a20:	0f b6 00             	movzbl (%eax),%eax
  100a23:	84 c0                	test   %al,%al
  100a25:	74 65                	je     100a8c <parse+0xb1>
            break;
        }

        // save and scan past next arg
        if (argc == MAXARGS - 1) {
  100a27:	83 7d f4 0f          	cmpl   $0xf,-0xc(%ebp)
  100a2b:	75 14                	jne    100a41 <parse+0x66>
            cprintf("Too many arguments (max %d).\n", MAXARGS);
  100a2d:	c7 44 24 04 10 00 00 	movl   $0x10,0x4(%esp)
  100a34:	00 
  100a35:	c7 04 24 ed 62 10 00 	movl   $0x1062ed,(%esp)
  100a3c:	e8 25 f9 ff ff       	call   100366 <cprintf>
        }
        argv[argc ++] = buf;
  100a41:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100a44:	8d 50 01             	lea    0x1(%eax),%edx
  100a47:	89 55 f4             	mov    %edx,-0xc(%ebp)
  100a4a:	8d 14 85 00 00 00 00 	lea    0x0(,%eax,4),%edx
  100a51:	8b 45 0c             	mov    0xc(%ebp),%eax
  100a54:	01 c2                	add    %eax,%edx
  100a56:	8b 45 08             	mov    0x8(%ebp),%eax
  100a59:	89 02                	mov    %eax,(%edx)
        while (*buf != '\0' && strchr(WHITESPACE, *buf) == NULL) {
  100a5b:	eb 03                	jmp    100a60 <parse+0x85>
            buf ++;
  100a5d:	ff 45 08             	incl   0x8(%ebp)
        while (*buf != '\0' && strchr(WHITESPACE, *buf) == NULL) {
  100a60:	8b 45 08             	mov    0x8(%ebp),%eax
  100a63:	0f b6 00             	movzbl (%eax),%eax
  100a66:	84 c0                	test   %al,%al
  100a68:	74 8c                	je     1009f6 <parse+0x1b>
  100a6a:	8b 45 08             	mov    0x8(%ebp),%eax
  100a6d:	0f b6 00             	movzbl (%eax),%eax
  100a70:	0f be c0             	movsbl %al,%eax
  100a73:	89 44 24 04          	mov    %eax,0x4(%esp)
  100a77:	c7 04 24 e8 62 10 00 	movl   $0x1062e8,(%esp)
  100a7e:	e8 0f 53 00 00       	call   105d92 <strchr>
  100a83:	85 c0                	test   %eax,%eax
  100a85:	74 d6                	je     100a5d <parse+0x82>
        while (*buf != '\0' && strchr(WHITESPACE, *buf) != NULL) {
  100a87:	e9 6a ff ff ff       	jmp    1009f6 <parse+0x1b>
            break;
  100a8c:	90                   	nop
        }
    }
    return argc;
  100a8d:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
  100a90:	89 ec                	mov    %ebp,%esp
  100a92:	5d                   	pop    %ebp
  100a93:	c3                   	ret    

00100a94 <runcmd>:
/* *
 * runcmd - parse the input string, split it into separated arguments
 * and then lookup and invoke some related commands/
 * */
static int
runcmd(char *buf, struct trapframe *tf) {
  100a94:	55                   	push   %ebp
  100a95:	89 e5                	mov    %esp,%ebp
  100a97:	83 ec 68             	sub    $0x68,%esp
  100a9a:	89 5d fc             	mov    %ebx,-0x4(%ebp)
    char *argv[MAXARGS];
    int argc = parse(buf, argv);
  100a9d:	8d 45 b0             	lea    -0x50(%ebp),%eax
  100aa0:	89 44 24 04          	mov    %eax,0x4(%esp)
  100aa4:	8b 45 08             	mov    0x8(%ebp),%eax
  100aa7:	89 04 24             	mov    %eax,(%esp)
  100aaa:	e8 2c ff ff ff       	call   1009db <parse>
  100aaf:	89 45 f0             	mov    %eax,-0x10(%ebp)
    if (argc == 0) {
  100ab2:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
  100ab6:	75 0a                	jne    100ac2 <runcmd+0x2e>
        return 0;
  100ab8:	b8 00 00 00 00       	mov    $0x0,%eax
  100abd:	e9 83 00 00 00       	jmp    100b45 <runcmd+0xb1>
    }
    int i;
    for (i = 0; i < NCOMMANDS; i ++) {
  100ac2:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
  100ac9:	eb 5a                	jmp    100b25 <runcmd+0x91>
        if (strcmp(commands[i].name, argv[0]) == 0) {
  100acb:	8b 55 b0             	mov    -0x50(%ebp),%edx
  100ace:	8b 4d f4             	mov    -0xc(%ebp),%ecx
  100ad1:	89 c8                	mov    %ecx,%eax
  100ad3:	01 c0                	add    %eax,%eax
  100ad5:	01 c8                	add    %ecx,%eax
  100ad7:	c1 e0 02             	shl    $0x2,%eax
  100ada:	05 00 90 11 00       	add    $0x119000,%eax
  100adf:	8b 00                	mov    (%eax),%eax
  100ae1:	89 54 24 04          	mov    %edx,0x4(%esp)
  100ae5:	89 04 24             	mov    %eax,(%esp)
  100ae8:	e8 09 52 00 00       	call   105cf6 <strcmp>
  100aed:	85 c0                	test   %eax,%eax
  100aef:	75 31                	jne    100b22 <runcmd+0x8e>
            return commands[i].func(argc - 1, argv + 1, tf);
  100af1:	8b 55 f4             	mov    -0xc(%ebp),%edx
  100af4:	89 d0                	mov    %edx,%eax
  100af6:	01 c0                	add    %eax,%eax
  100af8:	01 d0                	add    %edx,%eax
  100afa:	c1 e0 02             	shl    $0x2,%eax
  100afd:	05 08 90 11 00       	add    $0x119008,%eax
  100b02:	8b 10                	mov    (%eax),%edx
  100b04:	8d 45 b0             	lea    -0x50(%ebp),%eax
  100b07:	83 c0 04             	add    $0x4,%eax
  100b0a:	8b 4d f0             	mov    -0x10(%ebp),%ecx
  100b0d:	8d 59 ff             	lea    -0x1(%ecx),%ebx
  100b10:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  100b13:	89 4c 24 08          	mov    %ecx,0x8(%esp)
  100b17:	89 44 24 04          	mov    %eax,0x4(%esp)
  100b1b:	89 1c 24             	mov    %ebx,(%esp)
  100b1e:	ff d2                	call   *%edx
  100b20:	eb 23                	jmp    100b45 <runcmd+0xb1>
    for (i = 0; i < NCOMMANDS; i ++) {
  100b22:	ff 45 f4             	incl   -0xc(%ebp)
  100b25:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100b28:	83 f8 02             	cmp    $0x2,%eax
  100b2b:	76 9e                	jbe    100acb <runcmd+0x37>
        }
    }
    cprintf("Unknown command '%s'\n", argv[0]);
  100b2d:	8b 45 b0             	mov    -0x50(%ebp),%eax
  100b30:	89 44 24 04          	mov    %eax,0x4(%esp)
  100b34:	c7 04 24 0b 63 10 00 	movl   $0x10630b,(%esp)
  100b3b:	e8 26 f8 ff ff       	call   100366 <cprintf>
    return 0;
  100b40:	b8 00 00 00 00       	mov    $0x0,%eax
}
  100b45:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  100b48:	89 ec                	mov    %ebp,%esp
  100b4a:	5d                   	pop    %ebp
  100b4b:	c3                   	ret    

00100b4c <kmonitor>:

/***** Implementations of basic kernel monitor commands *****/

void
kmonitor(struct trapframe *tf) {
  100b4c:	55                   	push   %ebp
  100b4d:	89 e5                	mov    %esp,%ebp
  100b4f:	83 ec 28             	sub    $0x28,%esp
    cprintf("Welcome to the kernel debug monitor!!\n");
  100b52:	c7 04 24 24 63 10 00 	movl   $0x106324,(%esp)
  100b59:	e8 08 f8 ff ff       	call   100366 <cprintf>
    cprintf("Type 'help' for a list of commands.\n");
  100b5e:	c7 04 24 4c 63 10 00 	movl   $0x10634c,(%esp)
  100b65:	e8 fc f7 ff ff       	call   100366 <cprintf>

    if (tf != NULL) {
  100b6a:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
  100b6e:	74 0b                	je     100b7b <kmonitor+0x2f>
        print_trapframe(tf);
  100b70:	8b 45 08             	mov    0x8(%ebp),%eax
  100b73:	89 04 24             	mov    %eax,(%esp)
  100b76:	e8 cf 0e 00 00       	call   101a4a <print_trapframe>
    }

    char *buf;
    while (1) {
        if ((buf = readline("K> ")) != NULL) {
  100b7b:	c7 04 24 71 63 10 00 	movl   $0x106371,(%esp)
  100b82:	e8 d0 f6 ff ff       	call   100257 <readline>
  100b87:	89 45 f4             	mov    %eax,-0xc(%ebp)
  100b8a:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
  100b8e:	74 eb                	je     100b7b <kmonitor+0x2f>
            if (runcmd(buf, tf) < 0) {
  100b90:	8b 45 08             	mov    0x8(%ebp),%eax
  100b93:	89 44 24 04          	mov    %eax,0x4(%esp)
  100b97:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100b9a:	89 04 24             	mov    %eax,(%esp)
  100b9d:	e8 f2 fe ff ff       	call   100a94 <runcmd>
  100ba2:	85 c0                	test   %eax,%eax
  100ba4:	78 02                	js     100ba8 <kmonitor+0x5c>
        if ((buf = readline("K> ")) != NULL) {
  100ba6:	eb d3                	jmp    100b7b <kmonitor+0x2f>
                break;
  100ba8:	90                   	nop
            }
        }
    }
}
  100ba9:	90                   	nop
  100baa:	89 ec                	mov    %ebp,%esp
  100bac:	5d                   	pop    %ebp
  100bad:	c3                   	ret    

00100bae <mon_help>:

/* mon_help - print the information about mon_* functions */
int
mon_help(int argc, char **argv, struct trapframe *tf) {
  100bae:	55                   	push   %ebp
  100baf:	89 e5                	mov    %esp,%ebp
  100bb1:	83 ec 28             	sub    $0x28,%esp
    int i;
    for (i = 0; i < NCOMMANDS; i ++) {
  100bb4:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
  100bbb:	eb 3d                	jmp    100bfa <mon_help+0x4c>
        cprintf("%s - %s\n", commands[i].name, commands[i].desc);
  100bbd:	8b 55 f4             	mov    -0xc(%ebp),%edx
  100bc0:	89 d0                	mov    %edx,%eax
  100bc2:	01 c0                	add    %eax,%eax
  100bc4:	01 d0                	add    %edx,%eax
  100bc6:	c1 e0 02             	shl    $0x2,%eax
  100bc9:	05 04 90 11 00       	add    $0x119004,%eax
  100bce:	8b 10                	mov    (%eax),%edx
  100bd0:	8b 4d f4             	mov    -0xc(%ebp),%ecx
  100bd3:	89 c8                	mov    %ecx,%eax
  100bd5:	01 c0                	add    %eax,%eax
  100bd7:	01 c8                	add    %ecx,%eax
  100bd9:	c1 e0 02             	shl    $0x2,%eax
  100bdc:	05 00 90 11 00       	add    $0x119000,%eax
  100be1:	8b 00                	mov    (%eax),%eax
  100be3:	89 54 24 08          	mov    %edx,0x8(%esp)
  100be7:	89 44 24 04          	mov    %eax,0x4(%esp)
  100beb:	c7 04 24 75 63 10 00 	movl   $0x106375,(%esp)
  100bf2:	e8 6f f7 ff ff       	call   100366 <cprintf>
    for (i = 0; i < NCOMMANDS; i ++) {
  100bf7:	ff 45 f4             	incl   -0xc(%ebp)
  100bfa:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100bfd:	83 f8 02             	cmp    $0x2,%eax
  100c00:	76 bb                	jbe    100bbd <mon_help+0xf>
    }
    return 0;
  100c02:	b8 00 00 00 00       	mov    $0x0,%eax
}
  100c07:	89 ec                	mov    %ebp,%esp
  100c09:	5d                   	pop    %ebp
  100c0a:	c3                   	ret    

00100c0b <mon_kerninfo>:
/* *
 * mon_kerninfo - call print_kerninfo in kern/debug/kdebug.c to
 * print the memory occupancy in kernel.
 * */
int
mon_kerninfo(int argc, char **argv, struct trapframe *tf) {
  100c0b:	55                   	push   %ebp
  100c0c:	89 e5                	mov    %esp,%ebp
  100c0e:	83 ec 08             	sub    $0x8,%esp
    print_kerninfo();
  100c11:	e8 73 fc ff ff       	call   100889 <print_kerninfo>
    return 0;
  100c16:	b8 00 00 00 00       	mov    $0x0,%eax
}
  100c1b:	89 ec                	mov    %ebp,%esp
  100c1d:	5d                   	pop    %ebp
  100c1e:	c3                   	ret    

00100c1f <mon_backtrace>:
/* *
 * mon_backtrace - call print_stackframe in kern/debug/kdebug.c to
 * print a backtrace of the stack.
 * */
int
mon_backtrace(int argc, char **argv, struct trapframe *tf) {
  100c1f:	55                   	push   %ebp
  100c20:	89 e5                	mov    %esp,%ebp
  100c22:	83 ec 08             	sub    $0x8,%esp
    print_stackframe();
  100c25:	e8 ab fd ff ff       	call   1009d5 <print_stackframe>
    return 0;
  100c2a:	b8 00 00 00 00       	mov    $0x0,%eax
}
  100c2f:	89 ec                	mov    %ebp,%esp
  100c31:	5d                   	pop    %ebp
  100c32:	c3                   	ret    

00100c33 <__panic>:
/* *
 * __panic - __panic is called on unresolvable fatal errors. it prints
 * "panic: 'message'", and then enters the kernel monitor.
 * */
void
__panic(const char *file, int line, const char *fmt, ...) {
  100c33:	55                   	push   %ebp
  100c34:	89 e5                	mov    %esp,%ebp
  100c36:	83 ec 28             	sub    $0x28,%esp
    if (is_panic) {
  100c39:	a1 20 c4 11 00       	mov    0x11c420,%eax
  100c3e:	85 c0                	test   %eax,%eax
  100c40:	75 5b                	jne    100c9d <__panic+0x6a>
        goto panic_dead;
    }
    is_panic = 1;
  100c42:	c7 05 20 c4 11 00 01 	movl   $0x1,0x11c420
  100c49:	00 00 00 

    // print the 'message'
    va_list ap;
    va_start(ap, fmt);
  100c4c:	8d 45 14             	lea    0x14(%ebp),%eax
  100c4f:	89 45 f4             	mov    %eax,-0xc(%ebp)
    cprintf("kernel panic at %s:%d:\n    ", file, line);
  100c52:	8b 45 0c             	mov    0xc(%ebp),%eax
  100c55:	89 44 24 08          	mov    %eax,0x8(%esp)
  100c59:	8b 45 08             	mov    0x8(%ebp),%eax
  100c5c:	89 44 24 04          	mov    %eax,0x4(%esp)
  100c60:	c7 04 24 7e 63 10 00 	movl   $0x10637e,(%esp)
  100c67:	e8 fa f6 ff ff       	call   100366 <cprintf>
    vcprintf(fmt, ap);
  100c6c:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100c6f:	89 44 24 04          	mov    %eax,0x4(%esp)
  100c73:	8b 45 10             	mov    0x10(%ebp),%eax
  100c76:	89 04 24             	mov    %eax,(%esp)
  100c79:	e8 b3 f6 ff ff       	call   100331 <vcprintf>
    cprintf("\n");
  100c7e:	c7 04 24 9a 63 10 00 	movl   $0x10639a,(%esp)
  100c85:	e8 dc f6 ff ff       	call   100366 <cprintf>
    
    cprintf("stack trackback:\n");
  100c8a:	c7 04 24 9c 63 10 00 	movl   $0x10639c,(%esp)
  100c91:	e8 d0 f6 ff ff       	call   100366 <cprintf>
    print_stackframe();
  100c96:	e8 3a fd ff ff       	call   1009d5 <print_stackframe>
  100c9b:	eb 01                	jmp    100c9e <__panic+0x6b>
        goto panic_dead;
  100c9d:	90                   	nop
    
    va_end(ap);

panic_dead:
    intr_disable();
  100c9e:	e8 e9 09 00 00       	call   10168c <intr_disable>
    while (1) {
        kmonitor(NULL);
  100ca3:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  100caa:	e8 9d fe ff ff       	call   100b4c <kmonitor>
  100caf:	eb f2                	jmp    100ca3 <__panic+0x70>

00100cb1 <__warn>:
    }
}

/* __warn - like panic, but don't */
void
__warn(const char *file, int line, const char *fmt, ...) {
  100cb1:	55                   	push   %ebp
  100cb2:	89 e5                	mov    %esp,%ebp
  100cb4:	83 ec 28             	sub    $0x28,%esp
    va_list ap;
    va_start(ap, fmt);
  100cb7:	8d 45 14             	lea    0x14(%ebp),%eax
  100cba:	89 45 f4             	mov    %eax,-0xc(%ebp)
    cprintf("kernel warning at %s:%d:\n    ", file, line);
  100cbd:	8b 45 0c             	mov    0xc(%ebp),%eax
  100cc0:	89 44 24 08          	mov    %eax,0x8(%esp)
  100cc4:	8b 45 08             	mov    0x8(%ebp),%eax
  100cc7:	89 44 24 04          	mov    %eax,0x4(%esp)
  100ccb:	c7 04 24 ae 63 10 00 	movl   $0x1063ae,(%esp)
  100cd2:	e8 8f f6 ff ff       	call   100366 <cprintf>
    vcprintf(fmt, ap);
  100cd7:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100cda:	89 44 24 04          	mov    %eax,0x4(%esp)
  100cde:	8b 45 10             	mov    0x10(%ebp),%eax
  100ce1:	89 04 24             	mov    %eax,(%esp)
  100ce4:	e8 48 f6 ff ff       	call   100331 <vcprintf>
    cprintf("\n");
  100ce9:	c7 04 24 9a 63 10 00 	movl   $0x10639a,(%esp)
  100cf0:	e8 71 f6 ff ff       	call   100366 <cprintf>
    va_end(ap);
}
  100cf5:	90                   	nop
  100cf6:	89 ec                	mov    %ebp,%esp
  100cf8:	5d                   	pop    %ebp
  100cf9:	c3                   	ret    

00100cfa <is_kernel_panic>:

bool
is_kernel_panic(void) {
  100cfa:	55                   	push   %ebp
  100cfb:	89 e5                	mov    %esp,%ebp
    return is_panic;
  100cfd:	a1 20 c4 11 00       	mov    0x11c420,%eax
}
  100d02:	5d                   	pop    %ebp
  100d03:	c3                   	ret    

00100d04 <clock_init>:
/* *
 * clock_init - initialize 8253 clock to interrupt 100 times per second,
 * and then enable IRQ_TIMER.
 * */
void
clock_init(void) {
  100d04:	55                   	push   %ebp
  100d05:	89 e5                	mov    %esp,%ebp
  100d07:	83 ec 28             	sub    $0x28,%esp
  100d0a:	66 c7 45 ee 43 00    	movw   $0x43,-0x12(%ebp)
  100d10:	c6 45 ed 34          	movb   $0x34,-0x13(%ebp)
        : "memory", "cc");
}

static inline void
outb(uint16_t port, uint8_t data) {
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  100d14:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
  100d18:	0f b7 55 ee          	movzwl -0x12(%ebp),%edx
  100d1c:	ee                   	out    %al,(%dx)
}
  100d1d:	90                   	nop
  100d1e:	66 c7 45 f2 40 00    	movw   $0x40,-0xe(%ebp)
  100d24:	c6 45 f1 9c          	movb   $0x9c,-0xf(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  100d28:	0f b6 45 f1          	movzbl -0xf(%ebp),%eax
  100d2c:	0f b7 55 f2          	movzwl -0xe(%ebp),%edx
  100d30:	ee                   	out    %al,(%dx)
}
  100d31:	90                   	nop
  100d32:	66 c7 45 f6 40 00    	movw   $0x40,-0xa(%ebp)
  100d38:	c6 45 f5 2e          	movb   $0x2e,-0xb(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  100d3c:	0f b6 45 f5          	movzbl -0xb(%ebp),%eax
  100d40:	0f b7 55 f6          	movzwl -0xa(%ebp),%edx
  100d44:	ee                   	out    %al,(%dx)
}
  100d45:	90                   	nop
    outb(TIMER_MODE, TIMER_SEL0 | TIMER_RATEGEN | TIMER_16BIT);
    outb(IO_TIMER1, TIMER_DIV(100) % 256);
    outb(IO_TIMER1, TIMER_DIV(100) / 256);

    // initialize time counter 'ticks' to zero
    ticks = 0;
  100d46:	c7 05 24 c4 11 00 00 	movl   $0x0,0x11c424
  100d4d:	00 00 00 

    cprintf("++ setup timer interrupts\n");
  100d50:	c7 04 24 cc 63 10 00 	movl   $0x1063cc,(%esp)
  100d57:	e8 0a f6 ff ff       	call   100366 <cprintf>
    pic_enable(IRQ_TIMER);
  100d5c:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  100d63:	e8 89 09 00 00       	call   1016f1 <pic_enable>
}
  100d68:	90                   	nop
  100d69:	89 ec                	mov    %ebp,%esp
  100d6b:	5d                   	pop    %ebp
  100d6c:	c3                   	ret    

00100d6d <__intr_save>:
#include <x86.h>
#include <intr.h>
#include <mmu.h>

static inline bool
__intr_save(void) {
  100d6d:	55                   	push   %ebp
  100d6e:	89 e5                	mov    %esp,%ebp
  100d70:	83 ec 18             	sub    $0x18,%esp
}

static inline uint32_t
read_eflags(void) {
    uint32_t eflags;
    asm volatile ("pushfl; popl %0" : "=r" (eflags));
  100d73:	9c                   	pushf  
  100d74:	58                   	pop    %eax
  100d75:	89 45 f4             	mov    %eax,-0xc(%ebp)
    return eflags;
  100d78:	8b 45 f4             	mov    -0xc(%ebp),%eax
    if (read_eflags() & FL_IF) {
  100d7b:	25 00 02 00 00       	and    $0x200,%eax
  100d80:	85 c0                	test   %eax,%eax
  100d82:	74 0c                	je     100d90 <__intr_save+0x23>
        intr_disable();
  100d84:	e8 03 09 00 00       	call   10168c <intr_disable>
        return 1;
  100d89:	b8 01 00 00 00       	mov    $0x1,%eax
  100d8e:	eb 05                	jmp    100d95 <__intr_save+0x28>
    }
    return 0;
  100d90:	b8 00 00 00 00       	mov    $0x0,%eax
}
  100d95:	89 ec                	mov    %ebp,%esp
  100d97:	5d                   	pop    %ebp
  100d98:	c3                   	ret    

00100d99 <__intr_restore>:

static inline void
__intr_restore(bool flag) {
  100d99:	55                   	push   %ebp
  100d9a:	89 e5                	mov    %esp,%ebp
  100d9c:	83 ec 08             	sub    $0x8,%esp
    if (flag) {
  100d9f:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
  100da3:	74 05                	je     100daa <__intr_restore+0x11>
        intr_enable();
  100da5:	e8 da 08 00 00       	call   101684 <intr_enable>
    }
}
  100daa:	90                   	nop
  100dab:	89 ec                	mov    %ebp,%esp
  100dad:	5d                   	pop    %ebp
  100dae:	c3                   	ret    

00100daf <delay>:
#include <memlayout.h>
#include <sync.h>

/* stupid I/O delay routine necessitated by historical PC design flaws */
static void
delay(void) {
  100daf:	55                   	push   %ebp
  100db0:	89 e5                	mov    %esp,%ebp
  100db2:	83 ec 10             	sub    $0x10,%esp
  100db5:	66 c7 45 f2 84 00    	movw   $0x84,-0xe(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
  100dbb:	0f b7 45 f2          	movzwl -0xe(%ebp),%eax
  100dbf:	89 c2                	mov    %eax,%edx
  100dc1:	ec                   	in     (%dx),%al
  100dc2:	88 45 f1             	mov    %al,-0xf(%ebp)
  100dc5:	66 c7 45 f6 84 00    	movw   $0x84,-0xa(%ebp)
  100dcb:	0f b7 45 f6          	movzwl -0xa(%ebp),%eax
  100dcf:	89 c2                	mov    %eax,%edx
  100dd1:	ec                   	in     (%dx),%al
  100dd2:	88 45 f5             	mov    %al,-0xb(%ebp)
  100dd5:	66 c7 45 fa 84 00    	movw   $0x84,-0x6(%ebp)
  100ddb:	0f b7 45 fa          	movzwl -0x6(%ebp),%eax
  100ddf:	89 c2                	mov    %eax,%edx
  100de1:	ec                   	in     (%dx),%al
  100de2:	88 45 f9             	mov    %al,-0x7(%ebp)
  100de5:	66 c7 45 fe 84 00    	movw   $0x84,-0x2(%ebp)
  100deb:	0f b7 45 fe          	movzwl -0x2(%ebp),%eax
  100def:	89 c2                	mov    %eax,%edx
  100df1:	ec                   	in     (%dx),%al
  100df2:	88 45 fd             	mov    %al,-0x3(%ebp)
    inb(0x84);
    inb(0x84);
    inb(0x84);
    inb(0x84);
}
  100df5:	90                   	nop
  100df6:	89 ec                	mov    %ebp,%esp
  100df8:	5d                   	pop    %ebp
  100df9:	c3                   	ret    

00100dfa <cga_init>:
static uint16_t addr_6845;

/* TEXT-mode CGA/VGA display output */

static void
cga_init(void) {
  100dfa:	55                   	push   %ebp
  100dfb:	89 e5                	mov    %esp,%ebp
  100dfd:	83 ec 20             	sub    $0x20,%esp
    volatile uint16_t *cp = (uint16_t *)(CGA_BUF + KERNBASE);
  100e00:	c7 45 fc 00 80 0b c0 	movl   $0xc00b8000,-0x4(%ebp)
    uint16_t was = *cp;
  100e07:	8b 45 fc             	mov    -0x4(%ebp),%eax
  100e0a:	0f b7 00             	movzwl (%eax),%eax
  100e0d:	66 89 45 fa          	mov    %ax,-0x6(%ebp)
    *cp = (uint16_t) 0xA55A;
  100e11:	8b 45 fc             	mov    -0x4(%ebp),%eax
  100e14:	66 c7 00 5a a5       	movw   $0xa55a,(%eax)
    if (*cp != 0xA55A) {
  100e19:	8b 45 fc             	mov    -0x4(%ebp),%eax
  100e1c:	0f b7 00             	movzwl (%eax),%eax
  100e1f:	0f b7 c0             	movzwl %ax,%eax
  100e22:	3d 5a a5 00 00       	cmp    $0xa55a,%eax
  100e27:	74 12                	je     100e3b <cga_init+0x41>
        cp = (uint16_t*)(MONO_BUF + KERNBASE);
  100e29:	c7 45 fc 00 00 0b c0 	movl   $0xc00b0000,-0x4(%ebp)
        addr_6845 = MONO_BASE;
  100e30:	66 c7 05 46 c4 11 00 	movw   $0x3b4,0x11c446
  100e37:	b4 03 
  100e39:	eb 13                	jmp    100e4e <cga_init+0x54>
    } else {
        *cp = was;
  100e3b:	8b 45 fc             	mov    -0x4(%ebp),%eax
  100e3e:	0f b7 55 fa          	movzwl -0x6(%ebp),%edx
  100e42:	66 89 10             	mov    %dx,(%eax)
        addr_6845 = CGA_BASE;
  100e45:	66 c7 05 46 c4 11 00 	movw   $0x3d4,0x11c446
  100e4c:	d4 03 
    }

    // Extract cursor location
    uint32_t pos;
    outb(addr_6845, 14);
  100e4e:	0f b7 05 46 c4 11 00 	movzwl 0x11c446,%eax
  100e55:	66 89 45 e6          	mov    %ax,-0x1a(%ebp)
  100e59:	c6 45 e5 0e          	movb   $0xe,-0x1b(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  100e5d:	0f b6 45 e5          	movzbl -0x1b(%ebp),%eax
  100e61:	0f b7 55 e6          	movzwl -0x1a(%ebp),%edx
  100e65:	ee                   	out    %al,(%dx)
}
  100e66:	90                   	nop
    pos = inb(addr_6845 + 1) << 8;
  100e67:	0f b7 05 46 c4 11 00 	movzwl 0x11c446,%eax
  100e6e:	40                   	inc    %eax
  100e6f:	0f b7 c0             	movzwl %ax,%eax
  100e72:	66 89 45 ea          	mov    %ax,-0x16(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
  100e76:	0f b7 45 ea          	movzwl -0x16(%ebp),%eax
  100e7a:	89 c2                	mov    %eax,%edx
  100e7c:	ec                   	in     (%dx),%al
  100e7d:	88 45 e9             	mov    %al,-0x17(%ebp)
    return data;
  100e80:	0f b6 45 e9          	movzbl -0x17(%ebp),%eax
  100e84:	0f b6 c0             	movzbl %al,%eax
  100e87:	c1 e0 08             	shl    $0x8,%eax
  100e8a:	89 45 f4             	mov    %eax,-0xc(%ebp)
    outb(addr_6845, 15);
  100e8d:	0f b7 05 46 c4 11 00 	movzwl 0x11c446,%eax
  100e94:	66 89 45 ee          	mov    %ax,-0x12(%ebp)
  100e98:	c6 45 ed 0f          	movb   $0xf,-0x13(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  100e9c:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
  100ea0:	0f b7 55 ee          	movzwl -0x12(%ebp),%edx
  100ea4:	ee                   	out    %al,(%dx)
}
  100ea5:	90                   	nop
    pos |= inb(addr_6845 + 1);
  100ea6:	0f b7 05 46 c4 11 00 	movzwl 0x11c446,%eax
  100ead:	40                   	inc    %eax
  100eae:	0f b7 c0             	movzwl %ax,%eax
  100eb1:	66 89 45 f2          	mov    %ax,-0xe(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
  100eb5:	0f b7 45 f2          	movzwl -0xe(%ebp),%eax
  100eb9:	89 c2                	mov    %eax,%edx
  100ebb:	ec                   	in     (%dx),%al
  100ebc:	88 45 f1             	mov    %al,-0xf(%ebp)
    return data;
  100ebf:	0f b6 45 f1          	movzbl -0xf(%ebp),%eax
  100ec3:	0f b6 c0             	movzbl %al,%eax
  100ec6:	09 45 f4             	or     %eax,-0xc(%ebp)

    crt_buf = (uint16_t*) cp;
  100ec9:	8b 45 fc             	mov    -0x4(%ebp),%eax
  100ecc:	a3 40 c4 11 00       	mov    %eax,0x11c440
    crt_pos = pos;
  100ed1:	8b 45 f4             	mov    -0xc(%ebp),%eax
  100ed4:	0f b7 c0             	movzwl %ax,%eax
  100ed7:	66 a3 44 c4 11 00    	mov    %ax,0x11c444
}
  100edd:	90                   	nop
  100ede:	89 ec                	mov    %ebp,%esp
  100ee0:	5d                   	pop    %ebp
  100ee1:	c3                   	ret    

00100ee2 <serial_init>:

static bool serial_exists = 0;

static void
serial_init(void) {
  100ee2:	55                   	push   %ebp
  100ee3:	89 e5                	mov    %esp,%ebp
  100ee5:	83 ec 48             	sub    $0x48,%esp
  100ee8:	66 c7 45 d2 fa 03    	movw   $0x3fa,-0x2e(%ebp)
  100eee:	c6 45 d1 00          	movb   $0x0,-0x2f(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  100ef2:	0f b6 45 d1          	movzbl -0x2f(%ebp),%eax
  100ef6:	0f b7 55 d2          	movzwl -0x2e(%ebp),%edx
  100efa:	ee                   	out    %al,(%dx)
}
  100efb:	90                   	nop
  100efc:	66 c7 45 d6 fb 03    	movw   $0x3fb,-0x2a(%ebp)
  100f02:	c6 45 d5 80          	movb   $0x80,-0x2b(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  100f06:	0f b6 45 d5          	movzbl -0x2b(%ebp),%eax
  100f0a:	0f b7 55 d6          	movzwl -0x2a(%ebp),%edx
  100f0e:	ee                   	out    %al,(%dx)
}
  100f0f:	90                   	nop
  100f10:	66 c7 45 da f8 03    	movw   $0x3f8,-0x26(%ebp)
  100f16:	c6 45 d9 0c          	movb   $0xc,-0x27(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  100f1a:	0f b6 45 d9          	movzbl -0x27(%ebp),%eax
  100f1e:	0f b7 55 da          	movzwl -0x26(%ebp),%edx
  100f22:	ee                   	out    %al,(%dx)
}
  100f23:	90                   	nop
  100f24:	66 c7 45 de f9 03    	movw   $0x3f9,-0x22(%ebp)
  100f2a:	c6 45 dd 00          	movb   $0x0,-0x23(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  100f2e:	0f b6 45 dd          	movzbl -0x23(%ebp),%eax
  100f32:	0f b7 55 de          	movzwl -0x22(%ebp),%edx
  100f36:	ee                   	out    %al,(%dx)
}
  100f37:	90                   	nop
  100f38:	66 c7 45 e2 fb 03    	movw   $0x3fb,-0x1e(%ebp)
  100f3e:	c6 45 e1 03          	movb   $0x3,-0x1f(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  100f42:	0f b6 45 e1          	movzbl -0x1f(%ebp),%eax
  100f46:	0f b7 55 e2          	movzwl -0x1e(%ebp),%edx
  100f4a:	ee                   	out    %al,(%dx)
}
  100f4b:	90                   	nop
  100f4c:	66 c7 45 e6 fc 03    	movw   $0x3fc,-0x1a(%ebp)
  100f52:	c6 45 e5 00          	movb   $0x0,-0x1b(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  100f56:	0f b6 45 e5          	movzbl -0x1b(%ebp),%eax
  100f5a:	0f b7 55 e6          	movzwl -0x1a(%ebp),%edx
  100f5e:	ee                   	out    %al,(%dx)
}
  100f5f:	90                   	nop
  100f60:	66 c7 45 ea f9 03    	movw   $0x3f9,-0x16(%ebp)
  100f66:	c6 45 e9 01          	movb   $0x1,-0x17(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  100f6a:	0f b6 45 e9          	movzbl -0x17(%ebp),%eax
  100f6e:	0f b7 55 ea          	movzwl -0x16(%ebp),%edx
  100f72:	ee                   	out    %al,(%dx)
}
  100f73:	90                   	nop
  100f74:	66 c7 45 ee fd 03    	movw   $0x3fd,-0x12(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
  100f7a:	0f b7 45 ee          	movzwl -0x12(%ebp),%eax
  100f7e:	89 c2                	mov    %eax,%edx
  100f80:	ec                   	in     (%dx),%al
  100f81:	88 45 ed             	mov    %al,-0x13(%ebp)
    return data;
  100f84:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
    // Enable rcv interrupts
    outb(COM1 + COM_IER, COM_IER_RDI);

    // Clear any preexisting overrun indications and interrupts
    // Serial port doesn't exist if COM_LSR returns 0xFF
    serial_exists = (inb(COM1 + COM_LSR) != 0xFF);
  100f88:	3c ff                	cmp    $0xff,%al
  100f8a:	0f 95 c0             	setne  %al
  100f8d:	0f b6 c0             	movzbl %al,%eax
  100f90:	a3 48 c4 11 00       	mov    %eax,0x11c448
  100f95:	66 c7 45 f2 fa 03    	movw   $0x3fa,-0xe(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
  100f9b:	0f b7 45 f2          	movzwl -0xe(%ebp),%eax
  100f9f:	89 c2                	mov    %eax,%edx
  100fa1:	ec                   	in     (%dx),%al
  100fa2:	88 45 f1             	mov    %al,-0xf(%ebp)
  100fa5:	66 c7 45 f6 f8 03    	movw   $0x3f8,-0xa(%ebp)
  100fab:	0f b7 45 f6          	movzwl -0xa(%ebp),%eax
  100faf:	89 c2                	mov    %eax,%edx
  100fb1:	ec                   	in     (%dx),%al
  100fb2:	88 45 f5             	mov    %al,-0xb(%ebp)
    (void) inb(COM1+COM_IIR);
    (void) inb(COM1+COM_RX);

    if (serial_exists) {
  100fb5:	a1 48 c4 11 00       	mov    0x11c448,%eax
  100fba:	85 c0                	test   %eax,%eax
  100fbc:	74 0c                	je     100fca <serial_init+0xe8>
        pic_enable(IRQ_COM1);
  100fbe:	c7 04 24 04 00 00 00 	movl   $0x4,(%esp)
  100fc5:	e8 27 07 00 00       	call   1016f1 <pic_enable>
    }
}
  100fca:	90                   	nop
  100fcb:	89 ec                	mov    %ebp,%esp
  100fcd:	5d                   	pop    %ebp
  100fce:	c3                   	ret    

00100fcf <lpt_putc_sub>:

static void
lpt_putc_sub(int c) {
  100fcf:	55                   	push   %ebp
  100fd0:	89 e5                	mov    %esp,%ebp
  100fd2:	83 ec 20             	sub    $0x20,%esp
    int i;
    for (i = 0; !(inb(LPTPORT + 1) & 0x80) && i < 12800; i ++) {
  100fd5:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
  100fdc:	eb 08                	jmp    100fe6 <lpt_putc_sub+0x17>
        delay();
  100fde:	e8 cc fd ff ff       	call   100daf <delay>
    for (i = 0; !(inb(LPTPORT + 1) & 0x80) && i < 12800; i ++) {
  100fe3:	ff 45 fc             	incl   -0x4(%ebp)
  100fe6:	66 c7 45 fa 79 03    	movw   $0x379,-0x6(%ebp)
  100fec:	0f b7 45 fa          	movzwl -0x6(%ebp),%eax
  100ff0:	89 c2                	mov    %eax,%edx
  100ff2:	ec                   	in     (%dx),%al
  100ff3:	88 45 f9             	mov    %al,-0x7(%ebp)
    return data;
  100ff6:	0f b6 45 f9          	movzbl -0x7(%ebp),%eax
  100ffa:	84 c0                	test   %al,%al
  100ffc:	78 09                	js     101007 <lpt_putc_sub+0x38>
  100ffe:	81 7d fc ff 31 00 00 	cmpl   $0x31ff,-0x4(%ebp)
  101005:	7e d7                	jle    100fde <lpt_putc_sub+0xf>
    }
    outb(LPTPORT + 0, c);
  101007:	8b 45 08             	mov    0x8(%ebp),%eax
  10100a:	0f b6 c0             	movzbl %al,%eax
  10100d:	66 c7 45 ee 78 03    	movw   $0x378,-0x12(%ebp)
  101013:	88 45 ed             	mov    %al,-0x13(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  101016:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
  10101a:	0f b7 55 ee          	movzwl -0x12(%ebp),%edx
  10101e:	ee                   	out    %al,(%dx)
}
  10101f:	90                   	nop
  101020:	66 c7 45 f2 7a 03    	movw   $0x37a,-0xe(%ebp)
  101026:	c6 45 f1 0d          	movb   $0xd,-0xf(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  10102a:	0f b6 45 f1          	movzbl -0xf(%ebp),%eax
  10102e:	0f b7 55 f2          	movzwl -0xe(%ebp),%edx
  101032:	ee                   	out    %al,(%dx)
}
  101033:	90                   	nop
  101034:	66 c7 45 f6 7a 03    	movw   $0x37a,-0xa(%ebp)
  10103a:	c6 45 f5 08          	movb   $0x8,-0xb(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  10103e:	0f b6 45 f5          	movzbl -0xb(%ebp),%eax
  101042:	0f b7 55 f6          	movzwl -0xa(%ebp),%edx
  101046:	ee                   	out    %al,(%dx)
}
  101047:	90                   	nop
    outb(LPTPORT + 2, 0x08 | 0x04 | 0x01);
    outb(LPTPORT + 2, 0x08);
}
  101048:	90                   	nop
  101049:	89 ec                	mov    %ebp,%esp
  10104b:	5d                   	pop    %ebp
  10104c:	c3                   	ret    

0010104d <lpt_putc>:

/* lpt_putc - copy console output to parallel port */
static void
lpt_putc(int c) {
  10104d:	55                   	push   %ebp
  10104e:	89 e5                	mov    %esp,%ebp
  101050:	83 ec 04             	sub    $0x4,%esp
    if (c != '\b') {
  101053:	83 7d 08 08          	cmpl   $0x8,0x8(%ebp)
  101057:	74 0d                	je     101066 <lpt_putc+0x19>
        lpt_putc_sub(c);
  101059:	8b 45 08             	mov    0x8(%ebp),%eax
  10105c:	89 04 24             	mov    %eax,(%esp)
  10105f:	e8 6b ff ff ff       	call   100fcf <lpt_putc_sub>
    else {
        lpt_putc_sub('\b');
        lpt_putc_sub(' ');
        lpt_putc_sub('\b');
    }
}
  101064:	eb 24                	jmp    10108a <lpt_putc+0x3d>
        lpt_putc_sub('\b');
  101066:	c7 04 24 08 00 00 00 	movl   $0x8,(%esp)
  10106d:	e8 5d ff ff ff       	call   100fcf <lpt_putc_sub>
        lpt_putc_sub(' ');
  101072:	c7 04 24 20 00 00 00 	movl   $0x20,(%esp)
  101079:	e8 51 ff ff ff       	call   100fcf <lpt_putc_sub>
        lpt_putc_sub('\b');
  10107e:	c7 04 24 08 00 00 00 	movl   $0x8,(%esp)
  101085:	e8 45 ff ff ff       	call   100fcf <lpt_putc_sub>
}
  10108a:	90                   	nop
  10108b:	89 ec                	mov    %ebp,%esp
  10108d:	5d                   	pop    %ebp
  10108e:	c3                   	ret    

0010108f <cga_putc>:

/* cga_putc - print character to console */
static void
cga_putc(int c) {
  10108f:	55                   	push   %ebp
  101090:	89 e5                	mov    %esp,%ebp
  101092:	83 ec 38             	sub    $0x38,%esp
  101095:	89 5d fc             	mov    %ebx,-0x4(%ebp)
    // set black on white
    if (!(c & ~0xFF)) {
  101098:	8b 45 08             	mov    0x8(%ebp),%eax
  10109b:	25 00 ff ff ff       	and    $0xffffff00,%eax
  1010a0:	85 c0                	test   %eax,%eax
  1010a2:	75 07                	jne    1010ab <cga_putc+0x1c>
        c |= 0x0700;
  1010a4:	81 4d 08 00 07 00 00 	orl    $0x700,0x8(%ebp)
    }

    switch (c & 0xff) {
  1010ab:	8b 45 08             	mov    0x8(%ebp),%eax
  1010ae:	0f b6 c0             	movzbl %al,%eax
  1010b1:	83 f8 0d             	cmp    $0xd,%eax
  1010b4:	74 72                	je     101128 <cga_putc+0x99>
  1010b6:	83 f8 0d             	cmp    $0xd,%eax
  1010b9:	0f 8f a3 00 00 00    	jg     101162 <cga_putc+0xd3>
  1010bf:	83 f8 08             	cmp    $0x8,%eax
  1010c2:	74 0a                	je     1010ce <cga_putc+0x3f>
  1010c4:	83 f8 0a             	cmp    $0xa,%eax
  1010c7:	74 4c                	je     101115 <cga_putc+0x86>
  1010c9:	e9 94 00 00 00       	jmp    101162 <cga_putc+0xd3>
    case '\b':
        if (crt_pos > 0) {
  1010ce:	0f b7 05 44 c4 11 00 	movzwl 0x11c444,%eax
  1010d5:	85 c0                	test   %eax,%eax
  1010d7:	0f 84 af 00 00 00    	je     10118c <cga_putc+0xfd>
            crt_pos --;
  1010dd:	0f b7 05 44 c4 11 00 	movzwl 0x11c444,%eax
  1010e4:	48                   	dec    %eax
  1010e5:	0f b7 c0             	movzwl %ax,%eax
  1010e8:	66 a3 44 c4 11 00    	mov    %ax,0x11c444
            crt_buf[crt_pos] = (c & ~0xff) | ' ';
  1010ee:	8b 45 08             	mov    0x8(%ebp),%eax
  1010f1:	98                   	cwtl   
  1010f2:	25 00 ff ff ff       	and    $0xffffff00,%eax
  1010f7:	98                   	cwtl   
  1010f8:	83 c8 20             	or     $0x20,%eax
  1010fb:	98                   	cwtl   
  1010fc:	8b 0d 40 c4 11 00    	mov    0x11c440,%ecx
  101102:	0f b7 15 44 c4 11 00 	movzwl 0x11c444,%edx
  101109:	01 d2                	add    %edx,%edx
  10110b:	01 ca                	add    %ecx,%edx
  10110d:	0f b7 c0             	movzwl %ax,%eax
  101110:	66 89 02             	mov    %ax,(%edx)
        }
        break;
  101113:	eb 77                	jmp    10118c <cga_putc+0xfd>
    case '\n':
        crt_pos += CRT_COLS;
  101115:	0f b7 05 44 c4 11 00 	movzwl 0x11c444,%eax
  10111c:	83 c0 50             	add    $0x50,%eax
  10111f:	0f b7 c0             	movzwl %ax,%eax
  101122:	66 a3 44 c4 11 00    	mov    %ax,0x11c444
    case '\r':
        crt_pos -= (crt_pos % CRT_COLS);
  101128:	0f b7 1d 44 c4 11 00 	movzwl 0x11c444,%ebx
  10112f:	0f b7 0d 44 c4 11 00 	movzwl 0x11c444,%ecx
  101136:	ba cd cc cc cc       	mov    $0xcccccccd,%edx
  10113b:	89 c8                	mov    %ecx,%eax
  10113d:	f7 e2                	mul    %edx
  10113f:	c1 ea 06             	shr    $0x6,%edx
  101142:	89 d0                	mov    %edx,%eax
  101144:	c1 e0 02             	shl    $0x2,%eax
  101147:	01 d0                	add    %edx,%eax
  101149:	c1 e0 04             	shl    $0x4,%eax
  10114c:	29 c1                	sub    %eax,%ecx
  10114e:	89 ca                	mov    %ecx,%edx
  101150:	0f b7 d2             	movzwl %dx,%edx
  101153:	89 d8                	mov    %ebx,%eax
  101155:	29 d0                	sub    %edx,%eax
  101157:	0f b7 c0             	movzwl %ax,%eax
  10115a:	66 a3 44 c4 11 00    	mov    %ax,0x11c444
        break;
  101160:	eb 2b                	jmp    10118d <cga_putc+0xfe>
    default:
        crt_buf[crt_pos ++] = c;     // write the character
  101162:	8b 0d 40 c4 11 00    	mov    0x11c440,%ecx
  101168:	0f b7 05 44 c4 11 00 	movzwl 0x11c444,%eax
  10116f:	8d 50 01             	lea    0x1(%eax),%edx
  101172:	0f b7 d2             	movzwl %dx,%edx
  101175:	66 89 15 44 c4 11 00 	mov    %dx,0x11c444
  10117c:	01 c0                	add    %eax,%eax
  10117e:	8d 14 01             	lea    (%ecx,%eax,1),%edx
  101181:	8b 45 08             	mov    0x8(%ebp),%eax
  101184:	0f b7 c0             	movzwl %ax,%eax
  101187:	66 89 02             	mov    %ax,(%edx)
        break;
  10118a:	eb 01                	jmp    10118d <cga_putc+0xfe>
        break;
  10118c:	90                   	nop
    }

    // What is the purpose of this?
    if (crt_pos >= CRT_SIZE) {
  10118d:	0f b7 05 44 c4 11 00 	movzwl 0x11c444,%eax
  101194:	3d cf 07 00 00       	cmp    $0x7cf,%eax
  101199:	76 5e                	jbe    1011f9 <cga_putc+0x16a>
        int i;
        memmove(crt_buf, crt_buf + CRT_COLS, (CRT_SIZE - CRT_COLS) * sizeof(uint16_t));
  10119b:	a1 40 c4 11 00       	mov    0x11c440,%eax
  1011a0:	8d 90 a0 00 00 00    	lea    0xa0(%eax),%edx
  1011a6:	a1 40 c4 11 00       	mov    0x11c440,%eax
  1011ab:	c7 44 24 08 00 0f 00 	movl   $0xf00,0x8(%esp)
  1011b2:	00 
  1011b3:	89 54 24 04          	mov    %edx,0x4(%esp)
  1011b7:	89 04 24             	mov    %eax,(%esp)
  1011ba:	e8 d1 4d 00 00       	call   105f90 <memmove>
        for (i = CRT_SIZE - CRT_COLS; i < CRT_SIZE; i ++) {
  1011bf:	c7 45 f4 80 07 00 00 	movl   $0x780,-0xc(%ebp)
  1011c6:	eb 15                	jmp    1011dd <cga_putc+0x14e>
            crt_buf[i] = 0x0700 | ' ';
  1011c8:	8b 15 40 c4 11 00    	mov    0x11c440,%edx
  1011ce:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1011d1:	01 c0                	add    %eax,%eax
  1011d3:	01 d0                	add    %edx,%eax
  1011d5:	66 c7 00 20 07       	movw   $0x720,(%eax)
        for (i = CRT_SIZE - CRT_COLS; i < CRT_SIZE; i ++) {
  1011da:	ff 45 f4             	incl   -0xc(%ebp)
  1011dd:	81 7d f4 cf 07 00 00 	cmpl   $0x7cf,-0xc(%ebp)
  1011e4:	7e e2                	jle    1011c8 <cga_putc+0x139>
        }
        crt_pos -= CRT_COLS;
  1011e6:	0f b7 05 44 c4 11 00 	movzwl 0x11c444,%eax
  1011ed:	83 e8 50             	sub    $0x50,%eax
  1011f0:	0f b7 c0             	movzwl %ax,%eax
  1011f3:	66 a3 44 c4 11 00    	mov    %ax,0x11c444
    }

    // move that little blinky thing
    outb(addr_6845, 14);
  1011f9:	0f b7 05 46 c4 11 00 	movzwl 0x11c446,%eax
  101200:	66 89 45 e6          	mov    %ax,-0x1a(%ebp)
  101204:	c6 45 e5 0e          	movb   $0xe,-0x1b(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  101208:	0f b6 45 e5          	movzbl -0x1b(%ebp),%eax
  10120c:	0f b7 55 e6          	movzwl -0x1a(%ebp),%edx
  101210:	ee                   	out    %al,(%dx)
}
  101211:	90                   	nop
    outb(addr_6845 + 1, crt_pos >> 8);
  101212:	0f b7 05 44 c4 11 00 	movzwl 0x11c444,%eax
  101219:	c1 e8 08             	shr    $0x8,%eax
  10121c:	0f b7 c0             	movzwl %ax,%eax
  10121f:	0f b6 c0             	movzbl %al,%eax
  101222:	0f b7 15 46 c4 11 00 	movzwl 0x11c446,%edx
  101229:	42                   	inc    %edx
  10122a:	0f b7 d2             	movzwl %dx,%edx
  10122d:	66 89 55 ea          	mov    %dx,-0x16(%ebp)
  101231:	88 45 e9             	mov    %al,-0x17(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  101234:	0f b6 45 e9          	movzbl -0x17(%ebp),%eax
  101238:	0f b7 55 ea          	movzwl -0x16(%ebp),%edx
  10123c:	ee                   	out    %al,(%dx)
}
  10123d:	90                   	nop
    outb(addr_6845, 15);
  10123e:	0f b7 05 46 c4 11 00 	movzwl 0x11c446,%eax
  101245:	66 89 45 ee          	mov    %ax,-0x12(%ebp)
  101249:	c6 45 ed 0f          	movb   $0xf,-0x13(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  10124d:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
  101251:	0f b7 55 ee          	movzwl -0x12(%ebp),%edx
  101255:	ee                   	out    %al,(%dx)
}
  101256:	90                   	nop
    outb(addr_6845 + 1, crt_pos);
  101257:	0f b7 05 44 c4 11 00 	movzwl 0x11c444,%eax
  10125e:	0f b6 c0             	movzbl %al,%eax
  101261:	0f b7 15 46 c4 11 00 	movzwl 0x11c446,%edx
  101268:	42                   	inc    %edx
  101269:	0f b7 d2             	movzwl %dx,%edx
  10126c:	66 89 55 f2          	mov    %dx,-0xe(%ebp)
  101270:	88 45 f1             	mov    %al,-0xf(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  101273:	0f b6 45 f1          	movzbl -0xf(%ebp),%eax
  101277:	0f b7 55 f2          	movzwl -0xe(%ebp),%edx
  10127b:	ee                   	out    %al,(%dx)
}
  10127c:	90                   	nop
}
  10127d:	90                   	nop
  10127e:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  101281:	89 ec                	mov    %ebp,%esp
  101283:	5d                   	pop    %ebp
  101284:	c3                   	ret    

00101285 <serial_putc_sub>:

static void
serial_putc_sub(int c) {
  101285:	55                   	push   %ebp
  101286:	89 e5                	mov    %esp,%ebp
  101288:	83 ec 10             	sub    $0x10,%esp
    int i;
    for (i = 0; !(inb(COM1 + COM_LSR) & COM_LSR_TXRDY) && i < 12800; i ++) {
  10128b:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
  101292:	eb 08                	jmp    10129c <serial_putc_sub+0x17>
        delay();
  101294:	e8 16 fb ff ff       	call   100daf <delay>
    for (i = 0; !(inb(COM1 + COM_LSR) & COM_LSR_TXRDY) && i < 12800; i ++) {
  101299:	ff 45 fc             	incl   -0x4(%ebp)
  10129c:	66 c7 45 fa fd 03    	movw   $0x3fd,-0x6(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
  1012a2:	0f b7 45 fa          	movzwl -0x6(%ebp),%eax
  1012a6:	89 c2                	mov    %eax,%edx
  1012a8:	ec                   	in     (%dx),%al
  1012a9:	88 45 f9             	mov    %al,-0x7(%ebp)
    return data;
  1012ac:	0f b6 45 f9          	movzbl -0x7(%ebp),%eax
  1012b0:	0f b6 c0             	movzbl %al,%eax
  1012b3:	83 e0 20             	and    $0x20,%eax
  1012b6:	85 c0                	test   %eax,%eax
  1012b8:	75 09                	jne    1012c3 <serial_putc_sub+0x3e>
  1012ba:	81 7d fc ff 31 00 00 	cmpl   $0x31ff,-0x4(%ebp)
  1012c1:	7e d1                	jle    101294 <serial_putc_sub+0xf>
    }
    outb(COM1 + COM_TX, c);
  1012c3:	8b 45 08             	mov    0x8(%ebp),%eax
  1012c6:	0f b6 c0             	movzbl %al,%eax
  1012c9:	66 c7 45 f6 f8 03    	movw   $0x3f8,-0xa(%ebp)
  1012cf:	88 45 f5             	mov    %al,-0xb(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  1012d2:	0f b6 45 f5          	movzbl -0xb(%ebp),%eax
  1012d6:	0f b7 55 f6          	movzwl -0xa(%ebp),%edx
  1012da:	ee                   	out    %al,(%dx)
}
  1012db:	90                   	nop
}
  1012dc:	90                   	nop
  1012dd:	89 ec                	mov    %ebp,%esp
  1012df:	5d                   	pop    %ebp
  1012e0:	c3                   	ret    

001012e1 <serial_putc>:

/* serial_putc - print character to serial port */
static void
serial_putc(int c) {
  1012e1:	55                   	push   %ebp
  1012e2:	89 e5                	mov    %esp,%ebp
  1012e4:	83 ec 04             	sub    $0x4,%esp
    if (c != '\b') {
  1012e7:	83 7d 08 08          	cmpl   $0x8,0x8(%ebp)
  1012eb:	74 0d                	je     1012fa <serial_putc+0x19>
        serial_putc_sub(c);
  1012ed:	8b 45 08             	mov    0x8(%ebp),%eax
  1012f0:	89 04 24             	mov    %eax,(%esp)
  1012f3:	e8 8d ff ff ff       	call   101285 <serial_putc_sub>
    else {
        serial_putc_sub('\b');
        serial_putc_sub(' ');
        serial_putc_sub('\b');
    }
}
  1012f8:	eb 24                	jmp    10131e <serial_putc+0x3d>
        serial_putc_sub('\b');
  1012fa:	c7 04 24 08 00 00 00 	movl   $0x8,(%esp)
  101301:	e8 7f ff ff ff       	call   101285 <serial_putc_sub>
        serial_putc_sub(' ');
  101306:	c7 04 24 20 00 00 00 	movl   $0x20,(%esp)
  10130d:	e8 73 ff ff ff       	call   101285 <serial_putc_sub>
        serial_putc_sub('\b');
  101312:	c7 04 24 08 00 00 00 	movl   $0x8,(%esp)
  101319:	e8 67 ff ff ff       	call   101285 <serial_putc_sub>
}
  10131e:	90                   	nop
  10131f:	89 ec                	mov    %ebp,%esp
  101321:	5d                   	pop    %ebp
  101322:	c3                   	ret    

00101323 <cons_intr>:
/* *
 * cons_intr - called by device interrupt routines to feed input
 * characters into the circular console input buffer.
 * */
static void
cons_intr(int (*proc)(void)) {
  101323:	55                   	push   %ebp
  101324:	89 e5                	mov    %esp,%ebp
  101326:	83 ec 18             	sub    $0x18,%esp
    int c;
    while ((c = (*proc)()) != -1) {
  101329:	eb 33                	jmp    10135e <cons_intr+0x3b>
        if (c != 0) {
  10132b:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
  10132f:	74 2d                	je     10135e <cons_intr+0x3b>
            cons.buf[cons.wpos ++] = c;
  101331:	a1 64 c6 11 00       	mov    0x11c664,%eax
  101336:	8d 50 01             	lea    0x1(%eax),%edx
  101339:	89 15 64 c6 11 00    	mov    %edx,0x11c664
  10133f:	8b 55 f4             	mov    -0xc(%ebp),%edx
  101342:	88 90 60 c4 11 00    	mov    %dl,0x11c460(%eax)
            if (cons.wpos == CONSBUFSIZE) {
  101348:	a1 64 c6 11 00       	mov    0x11c664,%eax
  10134d:	3d 00 02 00 00       	cmp    $0x200,%eax
  101352:	75 0a                	jne    10135e <cons_intr+0x3b>
                cons.wpos = 0;
  101354:	c7 05 64 c6 11 00 00 	movl   $0x0,0x11c664
  10135b:	00 00 00 
    while ((c = (*proc)()) != -1) {
  10135e:	8b 45 08             	mov    0x8(%ebp),%eax
  101361:	ff d0                	call   *%eax
  101363:	89 45 f4             	mov    %eax,-0xc(%ebp)
  101366:	83 7d f4 ff          	cmpl   $0xffffffff,-0xc(%ebp)
  10136a:	75 bf                	jne    10132b <cons_intr+0x8>
            }
        }
    }
}
  10136c:	90                   	nop
  10136d:	90                   	nop
  10136e:	89 ec                	mov    %ebp,%esp
  101370:	5d                   	pop    %ebp
  101371:	c3                   	ret    

00101372 <serial_proc_data>:

/* serial_proc_data - get data from serial port */
static int
serial_proc_data(void) {
  101372:	55                   	push   %ebp
  101373:	89 e5                	mov    %esp,%ebp
  101375:	83 ec 10             	sub    $0x10,%esp
  101378:	66 c7 45 fa fd 03    	movw   $0x3fd,-0x6(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
  10137e:	0f b7 45 fa          	movzwl -0x6(%ebp),%eax
  101382:	89 c2                	mov    %eax,%edx
  101384:	ec                   	in     (%dx),%al
  101385:	88 45 f9             	mov    %al,-0x7(%ebp)
    return data;
  101388:	0f b6 45 f9          	movzbl -0x7(%ebp),%eax
    if (!(inb(COM1 + COM_LSR) & COM_LSR_DATA)) {
  10138c:	0f b6 c0             	movzbl %al,%eax
  10138f:	83 e0 01             	and    $0x1,%eax
  101392:	85 c0                	test   %eax,%eax
  101394:	75 07                	jne    10139d <serial_proc_data+0x2b>
        return -1;
  101396:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
  10139b:	eb 2a                	jmp    1013c7 <serial_proc_data+0x55>
  10139d:	66 c7 45 f6 f8 03    	movw   $0x3f8,-0xa(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
  1013a3:	0f b7 45 f6          	movzwl -0xa(%ebp),%eax
  1013a7:	89 c2                	mov    %eax,%edx
  1013a9:	ec                   	in     (%dx),%al
  1013aa:	88 45 f5             	mov    %al,-0xb(%ebp)
    return data;
  1013ad:	0f b6 45 f5          	movzbl -0xb(%ebp),%eax
    }
    int c = inb(COM1 + COM_RX);
  1013b1:	0f b6 c0             	movzbl %al,%eax
  1013b4:	89 45 fc             	mov    %eax,-0x4(%ebp)
    if (c == 127) {
  1013b7:	83 7d fc 7f          	cmpl   $0x7f,-0x4(%ebp)
  1013bb:	75 07                	jne    1013c4 <serial_proc_data+0x52>
        c = '\b';
  1013bd:	c7 45 fc 08 00 00 00 	movl   $0x8,-0x4(%ebp)
    }
    return c;
  1013c4:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
  1013c7:	89 ec                	mov    %ebp,%esp
  1013c9:	5d                   	pop    %ebp
  1013ca:	c3                   	ret    

001013cb <serial_intr>:

/* serial_intr - try to feed input characters from serial port */
void
serial_intr(void) {
  1013cb:	55                   	push   %ebp
  1013cc:	89 e5                	mov    %esp,%ebp
  1013ce:	83 ec 18             	sub    $0x18,%esp
    if (serial_exists) {
  1013d1:	a1 48 c4 11 00       	mov    0x11c448,%eax
  1013d6:	85 c0                	test   %eax,%eax
  1013d8:	74 0c                	je     1013e6 <serial_intr+0x1b>
        cons_intr(serial_proc_data);
  1013da:	c7 04 24 72 13 10 00 	movl   $0x101372,(%esp)
  1013e1:	e8 3d ff ff ff       	call   101323 <cons_intr>
    }
}
  1013e6:	90                   	nop
  1013e7:	89 ec                	mov    %ebp,%esp
  1013e9:	5d                   	pop    %ebp
  1013ea:	c3                   	ret    

001013eb <kbd_proc_data>:
 *
 * The kbd_proc_data() function gets data from the keyboard.
 * If we finish a character, return it, else 0. And return -1 if no data.
 * */
static int
kbd_proc_data(void) {
  1013eb:	55                   	push   %ebp
  1013ec:	89 e5                	mov    %esp,%ebp
  1013ee:	83 ec 38             	sub    $0x38,%esp
  1013f1:	66 c7 45 f0 64 00    	movw   $0x64,-0x10(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
  1013f7:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1013fa:	89 c2                	mov    %eax,%edx
  1013fc:	ec                   	in     (%dx),%al
  1013fd:	88 45 ef             	mov    %al,-0x11(%ebp)
    return data;
  101400:	0f b6 45 ef          	movzbl -0x11(%ebp),%eax
    int c;
    uint8_t data;
    static uint32_t shift;

    if ((inb(KBSTATP) & KBS_DIB) == 0) {
  101404:	0f b6 c0             	movzbl %al,%eax
  101407:	83 e0 01             	and    $0x1,%eax
  10140a:	85 c0                	test   %eax,%eax
  10140c:	75 0a                	jne    101418 <kbd_proc_data+0x2d>
        return -1;
  10140e:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
  101413:	e9 56 01 00 00       	jmp    10156e <kbd_proc_data+0x183>
  101418:	66 c7 45 ec 60 00    	movw   $0x60,-0x14(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
  10141e:	8b 45 ec             	mov    -0x14(%ebp),%eax
  101421:	89 c2                	mov    %eax,%edx
  101423:	ec                   	in     (%dx),%al
  101424:	88 45 eb             	mov    %al,-0x15(%ebp)
    return data;
  101427:	0f b6 45 eb          	movzbl -0x15(%ebp),%eax
    }

    data = inb(KBDATAP);
  10142b:	88 45 f3             	mov    %al,-0xd(%ebp)

    if (data == 0xE0) {
  10142e:	80 7d f3 e0          	cmpb   $0xe0,-0xd(%ebp)
  101432:	75 17                	jne    10144b <kbd_proc_data+0x60>
        // E0 escape character
        shift |= E0ESC;
  101434:	a1 68 c6 11 00       	mov    0x11c668,%eax
  101439:	83 c8 40             	or     $0x40,%eax
  10143c:	a3 68 c6 11 00       	mov    %eax,0x11c668
        return 0;
  101441:	b8 00 00 00 00       	mov    $0x0,%eax
  101446:	e9 23 01 00 00       	jmp    10156e <kbd_proc_data+0x183>
    } else if (data & 0x80) {
  10144b:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
  10144f:	84 c0                	test   %al,%al
  101451:	79 45                	jns    101498 <kbd_proc_data+0xad>
        // Key released
        data = (shift & E0ESC ? data : data & 0x7F);
  101453:	a1 68 c6 11 00       	mov    0x11c668,%eax
  101458:	83 e0 40             	and    $0x40,%eax
  10145b:	85 c0                	test   %eax,%eax
  10145d:	75 08                	jne    101467 <kbd_proc_data+0x7c>
  10145f:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
  101463:	24 7f                	and    $0x7f,%al
  101465:	eb 04                	jmp    10146b <kbd_proc_data+0x80>
  101467:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
  10146b:	88 45 f3             	mov    %al,-0xd(%ebp)
        shift &= ~(shiftcode[data] | E0ESC);
  10146e:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
  101472:	0f b6 80 40 90 11 00 	movzbl 0x119040(%eax),%eax
  101479:	0c 40                	or     $0x40,%al
  10147b:	0f b6 c0             	movzbl %al,%eax
  10147e:	f7 d0                	not    %eax
  101480:	89 c2                	mov    %eax,%edx
  101482:	a1 68 c6 11 00       	mov    0x11c668,%eax
  101487:	21 d0                	and    %edx,%eax
  101489:	a3 68 c6 11 00       	mov    %eax,0x11c668
        return 0;
  10148e:	b8 00 00 00 00       	mov    $0x0,%eax
  101493:	e9 d6 00 00 00       	jmp    10156e <kbd_proc_data+0x183>
    } else if (shift & E0ESC) {
  101498:	a1 68 c6 11 00       	mov    0x11c668,%eax
  10149d:	83 e0 40             	and    $0x40,%eax
  1014a0:	85 c0                	test   %eax,%eax
  1014a2:	74 11                	je     1014b5 <kbd_proc_data+0xca>
        // Last character was an E0 escape; or with 0x80
        data |= 0x80;
  1014a4:	80 4d f3 80          	orb    $0x80,-0xd(%ebp)
        shift &= ~E0ESC;
  1014a8:	a1 68 c6 11 00       	mov    0x11c668,%eax
  1014ad:	83 e0 bf             	and    $0xffffffbf,%eax
  1014b0:	a3 68 c6 11 00       	mov    %eax,0x11c668
    }

    shift |= shiftcode[data];
  1014b5:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
  1014b9:	0f b6 80 40 90 11 00 	movzbl 0x119040(%eax),%eax
  1014c0:	0f b6 d0             	movzbl %al,%edx
  1014c3:	a1 68 c6 11 00       	mov    0x11c668,%eax
  1014c8:	09 d0                	or     %edx,%eax
  1014ca:	a3 68 c6 11 00       	mov    %eax,0x11c668
    shift ^= togglecode[data];
  1014cf:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
  1014d3:	0f b6 80 40 91 11 00 	movzbl 0x119140(%eax),%eax
  1014da:	0f b6 d0             	movzbl %al,%edx
  1014dd:	a1 68 c6 11 00       	mov    0x11c668,%eax
  1014e2:	31 d0                	xor    %edx,%eax
  1014e4:	a3 68 c6 11 00       	mov    %eax,0x11c668

    c = charcode[shift & (CTL | SHIFT)][data];
  1014e9:	a1 68 c6 11 00       	mov    0x11c668,%eax
  1014ee:	83 e0 03             	and    $0x3,%eax
  1014f1:	8b 14 85 40 95 11 00 	mov    0x119540(,%eax,4),%edx
  1014f8:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
  1014fc:	01 d0                	add    %edx,%eax
  1014fe:	0f b6 00             	movzbl (%eax),%eax
  101501:	0f b6 c0             	movzbl %al,%eax
  101504:	89 45 f4             	mov    %eax,-0xc(%ebp)
    if (shift & CAPSLOCK) {
  101507:	a1 68 c6 11 00       	mov    0x11c668,%eax
  10150c:	83 e0 08             	and    $0x8,%eax
  10150f:	85 c0                	test   %eax,%eax
  101511:	74 22                	je     101535 <kbd_proc_data+0x14a>
        if ('a' <= c && c <= 'z')
  101513:	83 7d f4 60          	cmpl   $0x60,-0xc(%ebp)
  101517:	7e 0c                	jle    101525 <kbd_proc_data+0x13a>
  101519:	83 7d f4 7a          	cmpl   $0x7a,-0xc(%ebp)
  10151d:	7f 06                	jg     101525 <kbd_proc_data+0x13a>
            c += 'A' - 'a';
  10151f:	83 6d f4 20          	subl   $0x20,-0xc(%ebp)
  101523:	eb 10                	jmp    101535 <kbd_proc_data+0x14a>
        else if ('A' <= c && c <= 'Z')
  101525:	83 7d f4 40          	cmpl   $0x40,-0xc(%ebp)
  101529:	7e 0a                	jle    101535 <kbd_proc_data+0x14a>
  10152b:	83 7d f4 5a          	cmpl   $0x5a,-0xc(%ebp)
  10152f:	7f 04                	jg     101535 <kbd_proc_data+0x14a>
            c += 'a' - 'A';
  101531:	83 45 f4 20          	addl   $0x20,-0xc(%ebp)
    }

    // Process special keys
    // Ctrl-Alt-Del: reboot
    if (!(~shift & (CTL | ALT)) && c == KEY_DEL) {
  101535:	a1 68 c6 11 00       	mov    0x11c668,%eax
  10153a:	f7 d0                	not    %eax
  10153c:	83 e0 06             	and    $0x6,%eax
  10153f:	85 c0                	test   %eax,%eax
  101541:	75 28                	jne    10156b <kbd_proc_data+0x180>
  101543:	81 7d f4 e9 00 00 00 	cmpl   $0xe9,-0xc(%ebp)
  10154a:	75 1f                	jne    10156b <kbd_proc_data+0x180>
        cprintf("Rebooting!\n");
  10154c:	c7 04 24 e7 63 10 00 	movl   $0x1063e7,(%esp)
  101553:	e8 0e ee ff ff       	call   100366 <cprintf>
  101558:	66 c7 45 e8 92 00    	movw   $0x92,-0x18(%ebp)
  10155e:	c6 45 e7 03          	movb   $0x3,-0x19(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  101562:	0f b6 45 e7          	movzbl -0x19(%ebp),%eax
  101566:	8b 55 e8             	mov    -0x18(%ebp),%edx
  101569:	ee                   	out    %al,(%dx)
}
  10156a:	90                   	nop
        outb(0x92, 0x3); // courtesy of Chris Frost
    }
    return c;
  10156b:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
  10156e:	89 ec                	mov    %ebp,%esp
  101570:	5d                   	pop    %ebp
  101571:	c3                   	ret    

00101572 <kbd_intr>:

/* kbd_intr - try to feed input characters from keyboard */
static void
kbd_intr(void) {
  101572:	55                   	push   %ebp
  101573:	89 e5                	mov    %esp,%ebp
  101575:	83 ec 18             	sub    $0x18,%esp
    cons_intr(kbd_proc_data);
  101578:	c7 04 24 eb 13 10 00 	movl   $0x1013eb,(%esp)
  10157f:	e8 9f fd ff ff       	call   101323 <cons_intr>
}
  101584:	90                   	nop
  101585:	89 ec                	mov    %ebp,%esp
  101587:	5d                   	pop    %ebp
  101588:	c3                   	ret    

00101589 <kbd_init>:

static void
kbd_init(void) {
  101589:	55                   	push   %ebp
  10158a:	89 e5                	mov    %esp,%ebp
  10158c:	83 ec 18             	sub    $0x18,%esp
    // drain the kbd buffer
    kbd_intr();
  10158f:	e8 de ff ff ff       	call   101572 <kbd_intr>
    pic_enable(IRQ_KBD);
  101594:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  10159b:	e8 51 01 00 00       	call   1016f1 <pic_enable>
}
  1015a0:	90                   	nop
  1015a1:	89 ec                	mov    %ebp,%esp
  1015a3:	5d                   	pop    %ebp
  1015a4:	c3                   	ret    

001015a5 <cons_init>:

/* cons_init - initializes the console devices */
void
cons_init(void) {
  1015a5:	55                   	push   %ebp
  1015a6:	89 e5                	mov    %esp,%ebp
  1015a8:	83 ec 18             	sub    $0x18,%esp
    cga_init();
  1015ab:	e8 4a f8 ff ff       	call   100dfa <cga_init>
    serial_init();
  1015b0:	e8 2d f9 ff ff       	call   100ee2 <serial_init>
    kbd_init();
  1015b5:	e8 cf ff ff ff       	call   101589 <kbd_init>
    if (!serial_exists) {
  1015ba:	a1 48 c4 11 00       	mov    0x11c448,%eax
  1015bf:	85 c0                	test   %eax,%eax
  1015c1:	75 0c                	jne    1015cf <cons_init+0x2a>
        cprintf("serial port does not exist!!\n");
  1015c3:	c7 04 24 f3 63 10 00 	movl   $0x1063f3,(%esp)
  1015ca:	e8 97 ed ff ff       	call   100366 <cprintf>
    }
}
  1015cf:	90                   	nop
  1015d0:	89 ec                	mov    %ebp,%esp
  1015d2:	5d                   	pop    %ebp
  1015d3:	c3                   	ret    

001015d4 <cons_putc>:

/* cons_putc - print a single character @c to console devices */
void
cons_putc(int c) {
  1015d4:	55                   	push   %ebp
  1015d5:	89 e5                	mov    %esp,%ebp
  1015d7:	83 ec 28             	sub    $0x28,%esp
    bool intr_flag;
    local_intr_save(intr_flag);
  1015da:	e8 8e f7 ff ff       	call   100d6d <__intr_save>
  1015df:	89 45 f4             	mov    %eax,-0xc(%ebp)
    {
        lpt_putc(c);
  1015e2:	8b 45 08             	mov    0x8(%ebp),%eax
  1015e5:	89 04 24             	mov    %eax,(%esp)
  1015e8:	e8 60 fa ff ff       	call   10104d <lpt_putc>
        cga_putc(c);
  1015ed:	8b 45 08             	mov    0x8(%ebp),%eax
  1015f0:	89 04 24             	mov    %eax,(%esp)
  1015f3:	e8 97 fa ff ff       	call   10108f <cga_putc>
        serial_putc(c);
  1015f8:	8b 45 08             	mov    0x8(%ebp),%eax
  1015fb:	89 04 24             	mov    %eax,(%esp)
  1015fe:	e8 de fc ff ff       	call   1012e1 <serial_putc>
    }
    local_intr_restore(intr_flag);
  101603:	8b 45 f4             	mov    -0xc(%ebp),%eax
  101606:	89 04 24             	mov    %eax,(%esp)
  101609:	e8 8b f7 ff ff       	call   100d99 <__intr_restore>
}
  10160e:	90                   	nop
  10160f:	89 ec                	mov    %ebp,%esp
  101611:	5d                   	pop    %ebp
  101612:	c3                   	ret    

00101613 <cons_getc>:
/* *
 * cons_getc - return the next input character from console,
 * or 0 if none waiting.
 * */
int
cons_getc(void) {
  101613:	55                   	push   %ebp
  101614:	89 e5                	mov    %esp,%ebp
  101616:	83 ec 28             	sub    $0x28,%esp
    int c = 0;
  101619:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    bool intr_flag;
    local_intr_save(intr_flag);
  101620:	e8 48 f7 ff ff       	call   100d6d <__intr_save>
  101625:	89 45 f0             	mov    %eax,-0x10(%ebp)
    {
        // poll for any pending input characters,
        // so that this function works even when interrupts are disabled
        // (e.g., when called from the kernel monitor).
        serial_intr();
  101628:	e8 9e fd ff ff       	call   1013cb <serial_intr>
        kbd_intr();
  10162d:	e8 40 ff ff ff       	call   101572 <kbd_intr>

        // grab the next character from the input buffer.
        if (cons.rpos != cons.wpos) {
  101632:	8b 15 60 c6 11 00    	mov    0x11c660,%edx
  101638:	a1 64 c6 11 00       	mov    0x11c664,%eax
  10163d:	39 c2                	cmp    %eax,%edx
  10163f:	74 31                	je     101672 <cons_getc+0x5f>
            c = cons.buf[cons.rpos ++];
  101641:	a1 60 c6 11 00       	mov    0x11c660,%eax
  101646:	8d 50 01             	lea    0x1(%eax),%edx
  101649:	89 15 60 c6 11 00    	mov    %edx,0x11c660
  10164f:	0f b6 80 60 c4 11 00 	movzbl 0x11c460(%eax),%eax
  101656:	0f b6 c0             	movzbl %al,%eax
  101659:	89 45 f4             	mov    %eax,-0xc(%ebp)
            if (cons.rpos == CONSBUFSIZE) {
  10165c:	a1 60 c6 11 00       	mov    0x11c660,%eax
  101661:	3d 00 02 00 00       	cmp    $0x200,%eax
  101666:	75 0a                	jne    101672 <cons_getc+0x5f>
                cons.rpos = 0;
  101668:	c7 05 60 c6 11 00 00 	movl   $0x0,0x11c660
  10166f:	00 00 00 
            }
        }
    }
    local_intr_restore(intr_flag);
  101672:	8b 45 f0             	mov    -0x10(%ebp),%eax
  101675:	89 04 24             	mov    %eax,(%esp)
  101678:	e8 1c f7 ff ff       	call   100d99 <__intr_restore>
    return c;
  10167d:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
  101680:	89 ec                	mov    %ebp,%esp
  101682:	5d                   	pop    %ebp
  101683:	c3                   	ret    

00101684 <intr_enable>:
#include <x86.h>
#include <intr.h>

/* intr_enable - enable irq interrupt */
void
intr_enable(void) {
  101684:	55                   	push   %ebp
  101685:	89 e5                	mov    %esp,%ebp
    asm volatile ("sti");
  101687:	fb                   	sti    
}
  101688:	90                   	nop
    sti();
}
  101689:	90                   	nop
  10168a:	5d                   	pop    %ebp
  10168b:	c3                   	ret    

0010168c <intr_disable>:

/* intr_disable - disable irq interrupt */
void
intr_disable(void) {
  10168c:	55                   	push   %ebp
  10168d:	89 e5                	mov    %esp,%ebp
    asm volatile ("cli" ::: "memory");
  10168f:	fa                   	cli    
}
  101690:	90                   	nop
    cli();
}
  101691:	90                   	nop
  101692:	5d                   	pop    %ebp
  101693:	c3                   	ret    

00101694 <pic_setmask>:
// Initial IRQ mask has interrupt 2 enabled (for slave 8259A).
static uint16_t irq_mask = 0xFFFF & ~(1 << IRQ_SLAVE);
static bool did_init = 0;

static void
pic_setmask(uint16_t mask) {
  101694:	55                   	push   %ebp
  101695:	89 e5                	mov    %esp,%ebp
  101697:	83 ec 14             	sub    $0x14,%esp
  10169a:	8b 45 08             	mov    0x8(%ebp),%eax
  10169d:	66 89 45 ec          	mov    %ax,-0x14(%ebp)
    irq_mask = mask;
  1016a1:	8b 45 ec             	mov    -0x14(%ebp),%eax
  1016a4:	66 a3 50 95 11 00    	mov    %ax,0x119550
    if (did_init) {
  1016aa:	a1 6c c6 11 00       	mov    0x11c66c,%eax
  1016af:	85 c0                	test   %eax,%eax
  1016b1:	74 39                	je     1016ec <pic_setmask+0x58>
        outb(IO_PIC1 + 1, mask);
  1016b3:	8b 45 ec             	mov    -0x14(%ebp),%eax
  1016b6:	0f b6 c0             	movzbl %al,%eax
  1016b9:	66 c7 45 fa 21 00    	movw   $0x21,-0x6(%ebp)
  1016bf:	88 45 f9             	mov    %al,-0x7(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  1016c2:	0f b6 45 f9          	movzbl -0x7(%ebp),%eax
  1016c6:	0f b7 55 fa          	movzwl -0x6(%ebp),%edx
  1016ca:	ee                   	out    %al,(%dx)
}
  1016cb:	90                   	nop
        outb(IO_PIC2 + 1, mask >> 8);
  1016cc:	0f b7 45 ec          	movzwl -0x14(%ebp),%eax
  1016d0:	c1 e8 08             	shr    $0x8,%eax
  1016d3:	0f b7 c0             	movzwl %ax,%eax
  1016d6:	0f b6 c0             	movzbl %al,%eax
  1016d9:	66 c7 45 fe a1 00    	movw   $0xa1,-0x2(%ebp)
  1016df:	88 45 fd             	mov    %al,-0x3(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  1016e2:	0f b6 45 fd          	movzbl -0x3(%ebp),%eax
  1016e6:	0f b7 55 fe          	movzwl -0x2(%ebp),%edx
  1016ea:	ee                   	out    %al,(%dx)
}
  1016eb:	90                   	nop
    }
}
  1016ec:	90                   	nop
  1016ed:	89 ec                	mov    %ebp,%esp
  1016ef:	5d                   	pop    %ebp
  1016f0:	c3                   	ret    

001016f1 <pic_enable>:

void
pic_enable(unsigned int irq) {
  1016f1:	55                   	push   %ebp
  1016f2:	89 e5                	mov    %esp,%ebp
  1016f4:	83 ec 04             	sub    $0x4,%esp
    pic_setmask(irq_mask & ~(1 << irq));
  1016f7:	8b 45 08             	mov    0x8(%ebp),%eax
  1016fa:	ba 01 00 00 00       	mov    $0x1,%edx
  1016ff:	88 c1                	mov    %al,%cl
  101701:	d3 e2                	shl    %cl,%edx
  101703:	89 d0                	mov    %edx,%eax
  101705:	98                   	cwtl   
  101706:	f7 d0                	not    %eax
  101708:	0f bf d0             	movswl %ax,%edx
  10170b:	0f b7 05 50 95 11 00 	movzwl 0x119550,%eax
  101712:	98                   	cwtl   
  101713:	21 d0                	and    %edx,%eax
  101715:	98                   	cwtl   
  101716:	0f b7 c0             	movzwl %ax,%eax
  101719:	89 04 24             	mov    %eax,(%esp)
  10171c:	e8 73 ff ff ff       	call   101694 <pic_setmask>
}
  101721:	90                   	nop
  101722:	89 ec                	mov    %ebp,%esp
  101724:	5d                   	pop    %ebp
  101725:	c3                   	ret    

00101726 <pic_init>:

/* pic_init - initialize the 8259A interrupt controllers */
void
pic_init(void) {
  101726:	55                   	push   %ebp
  101727:	89 e5                	mov    %esp,%ebp
  101729:	83 ec 44             	sub    $0x44,%esp
    did_init = 1;
  10172c:	c7 05 6c c6 11 00 01 	movl   $0x1,0x11c66c
  101733:	00 00 00 
  101736:	66 c7 45 ca 21 00    	movw   $0x21,-0x36(%ebp)
  10173c:	c6 45 c9 ff          	movb   $0xff,-0x37(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  101740:	0f b6 45 c9          	movzbl -0x37(%ebp),%eax
  101744:	0f b7 55 ca          	movzwl -0x36(%ebp),%edx
  101748:	ee                   	out    %al,(%dx)
}
  101749:	90                   	nop
  10174a:	66 c7 45 ce a1 00    	movw   $0xa1,-0x32(%ebp)
  101750:	c6 45 cd ff          	movb   $0xff,-0x33(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  101754:	0f b6 45 cd          	movzbl -0x33(%ebp),%eax
  101758:	0f b7 55 ce          	movzwl -0x32(%ebp),%edx
  10175c:	ee                   	out    %al,(%dx)
}
  10175d:	90                   	nop
  10175e:	66 c7 45 d2 20 00    	movw   $0x20,-0x2e(%ebp)
  101764:	c6 45 d1 11          	movb   $0x11,-0x2f(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  101768:	0f b6 45 d1          	movzbl -0x2f(%ebp),%eax
  10176c:	0f b7 55 d2          	movzwl -0x2e(%ebp),%edx
  101770:	ee                   	out    %al,(%dx)
}
  101771:	90                   	nop
  101772:	66 c7 45 d6 21 00    	movw   $0x21,-0x2a(%ebp)
  101778:	c6 45 d5 20          	movb   $0x20,-0x2b(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  10177c:	0f b6 45 d5          	movzbl -0x2b(%ebp),%eax
  101780:	0f b7 55 d6          	movzwl -0x2a(%ebp),%edx
  101784:	ee                   	out    %al,(%dx)
}
  101785:	90                   	nop
  101786:	66 c7 45 da 21 00    	movw   $0x21,-0x26(%ebp)
  10178c:	c6 45 d9 04          	movb   $0x4,-0x27(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  101790:	0f b6 45 d9          	movzbl -0x27(%ebp),%eax
  101794:	0f b7 55 da          	movzwl -0x26(%ebp),%edx
  101798:	ee                   	out    %al,(%dx)
}
  101799:	90                   	nop
  10179a:	66 c7 45 de 21 00    	movw   $0x21,-0x22(%ebp)
  1017a0:	c6 45 dd 03          	movb   $0x3,-0x23(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  1017a4:	0f b6 45 dd          	movzbl -0x23(%ebp),%eax
  1017a8:	0f b7 55 de          	movzwl -0x22(%ebp),%edx
  1017ac:	ee                   	out    %al,(%dx)
}
  1017ad:	90                   	nop
  1017ae:	66 c7 45 e2 a0 00    	movw   $0xa0,-0x1e(%ebp)
  1017b4:	c6 45 e1 11          	movb   $0x11,-0x1f(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  1017b8:	0f b6 45 e1          	movzbl -0x1f(%ebp),%eax
  1017bc:	0f b7 55 e2          	movzwl -0x1e(%ebp),%edx
  1017c0:	ee                   	out    %al,(%dx)
}
  1017c1:	90                   	nop
  1017c2:	66 c7 45 e6 a1 00    	movw   $0xa1,-0x1a(%ebp)
  1017c8:	c6 45 e5 28          	movb   $0x28,-0x1b(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  1017cc:	0f b6 45 e5          	movzbl -0x1b(%ebp),%eax
  1017d0:	0f b7 55 e6          	movzwl -0x1a(%ebp),%edx
  1017d4:	ee                   	out    %al,(%dx)
}
  1017d5:	90                   	nop
  1017d6:	66 c7 45 ea a1 00    	movw   $0xa1,-0x16(%ebp)
  1017dc:	c6 45 e9 02          	movb   $0x2,-0x17(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  1017e0:	0f b6 45 e9          	movzbl -0x17(%ebp),%eax
  1017e4:	0f b7 55 ea          	movzwl -0x16(%ebp),%edx
  1017e8:	ee                   	out    %al,(%dx)
}
  1017e9:	90                   	nop
  1017ea:	66 c7 45 ee a1 00    	movw   $0xa1,-0x12(%ebp)
  1017f0:	c6 45 ed 03          	movb   $0x3,-0x13(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  1017f4:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
  1017f8:	0f b7 55 ee          	movzwl -0x12(%ebp),%edx
  1017fc:	ee                   	out    %al,(%dx)
}
  1017fd:	90                   	nop
  1017fe:	66 c7 45 f2 20 00    	movw   $0x20,-0xe(%ebp)
  101804:	c6 45 f1 68          	movb   $0x68,-0xf(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  101808:	0f b6 45 f1          	movzbl -0xf(%ebp),%eax
  10180c:	0f b7 55 f2          	movzwl -0xe(%ebp),%edx
  101810:	ee                   	out    %al,(%dx)
}
  101811:	90                   	nop
  101812:	66 c7 45 f6 20 00    	movw   $0x20,-0xa(%ebp)
  101818:	c6 45 f5 0a          	movb   $0xa,-0xb(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  10181c:	0f b6 45 f5          	movzbl -0xb(%ebp),%eax
  101820:	0f b7 55 f6          	movzwl -0xa(%ebp),%edx
  101824:	ee                   	out    %al,(%dx)
}
  101825:	90                   	nop
  101826:	66 c7 45 fa a0 00    	movw   $0xa0,-0x6(%ebp)
  10182c:	c6 45 f9 68          	movb   $0x68,-0x7(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  101830:	0f b6 45 f9          	movzbl -0x7(%ebp),%eax
  101834:	0f b7 55 fa          	movzwl -0x6(%ebp),%edx
  101838:	ee                   	out    %al,(%dx)
}
  101839:	90                   	nop
  10183a:	66 c7 45 fe a0 00    	movw   $0xa0,-0x2(%ebp)
  101840:	c6 45 fd 0a          	movb   $0xa,-0x3(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
  101844:	0f b6 45 fd          	movzbl -0x3(%ebp),%eax
  101848:	0f b7 55 fe          	movzwl -0x2(%ebp),%edx
  10184c:	ee                   	out    %al,(%dx)
}
  10184d:	90                   	nop
    outb(IO_PIC1, 0x0a);    // read IRR by default

    outb(IO_PIC2, 0x68);    // OCW3
    outb(IO_PIC2, 0x0a);    // OCW3

    if (irq_mask != 0xFFFF) {
  10184e:	0f b7 05 50 95 11 00 	movzwl 0x119550,%eax
  101855:	3d ff ff 00 00       	cmp    $0xffff,%eax
  10185a:	74 0f                	je     10186b <pic_init+0x145>
        pic_setmask(irq_mask);
  10185c:	0f b7 05 50 95 11 00 	movzwl 0x119550,%eax
  101863:	89 04 24             	mov    %eax,(%esp)
  101866:	e8 29 fe ff ff       	call   101694 <pic_setmask>
    }
}
  10186b:	90                   	nop
  10186c:	89 ec                	mov    %ebp,%esp
  10186e:	5d                   	pop    %ebp
  10186f:	c3                   	ret    

00101870 <print_ticks>:
#include <console.h>
#include <kdebug.h>

#define TICK_NUM 100

static void print_ticks() {
  101870:	55                   	push   %ebp
  101871:	89 e5                	mov    %esp,%ebp
  101873:	83 ec 18             	sub    $0x18,%esp
    cprintf("%d ticks\n",TICK_NUM);
  101876:	c7 44 24 04 64 00 00 	movl   $0x64,0x4(%esp)
  10187d:	00 
  10187e:	c7 04 24 20 64 10 00 	movl   $0x106420,(%esp)
  101885:	e8 dc ea ff ff       	call   100366 <cprintf>
#ifdef DEBUG_GRADE
    cprintf("End of Test.\n");
    panic("EOT: kernel seems ok.");
#endif
}
  10188a:	90                   	nop
  10188b:	89 ec                	mov    %ebp,%esp
  10188d:	5d                   	pop    %ebp
  10188e:	c3                   	ret    

0010188f <idt_init>:
    sizeof(idt) - 1, (uintptr_t)idt
};

/* idt_init - initialize IDT to each of the entry points in kern/trap/vectors.S */
void
idt_init(void) {
  10188f:	55                   	push   %ebp
  101890:	89 e5                	mov    %esp,%ebp
  101892:	83 ec 10             	sub    $0x10,%esp
      *     You don't know the meaning of this instruction? just google it! and check the libs/x86.h to know more.
      *     Notice: the argument of lidt is idt_pd. try to find it!
      */
    extern uintptr_t __vectors[];//声明了一个外部数组 __vectors，该数组存储中断服务例程（ISR）的地址。
    int i;
    for (i = 0; i < sizeof(idt) / sizeof(struct gatedesc); i ++) {
  101895:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
  10189c:	e9 c4 00 00 00       	jmp    101965 <idt_init+0xd6>
        SETGATE(idt[i], 0, GD_KTEXT, __vectors[i], DPL_KERNEL);
  1018a1:	8b 45 fc             	mov    -0x4(%ebp),%eax
  1018a4:	8b 04 85 e0 95 11 00 	mov    0x1195e0(,%eax,4),%eax
  1018ab:	0f b7 d0             	movzwl %ax,%edx
  1018ae:	8b 45 fc             	mov    -0x4(%ebp),%eax
  1018b1:	66 89 14 c5 e0 c6 11 	mov    %dx,0x11c6e0(,%eax,8)
  1018b8:	00 
  1018b9:	8b 45 fc             	mov    -0x4(%ebp),%eax
  1018bc:	66 c7 04 c5 e2 c6 11 	movw   $0x8,0x11c6e2(,%eax,8)
  1018c3:	00 08 00 
  1018c6:	8b 45 fc             	mov    -0x4(%ebp),%eax
  1018c9:	0f b6 14 c5 e4 c6 11 	movzbl 0x11c6e4(,%eax,8),%edx
  1018d0:	00 
  1018d1:	80 e2 e0             	and    $0xe0,%dl
  1018d4:	88 14 c5 e4 c6 11 00 	mov    %dl,0x11c6e4(,%eax,8)
  1018db:	8b 45 fc             	mov    -0x4(%ebp),%eax
  1018de:	0f b6 14 c5 e4 c6 11 	movzbl 0x11c6e4(,%eax,8),%edx
  1018e5:	00 
  1018e6:	80 e2 1f             	and    $0x1f,%dl
  1018e9:	88 14 c5 e4 c6 11 00 	mov    %dl,0x11c6e4(,%eax,8)
  1018f0:	8b 45 fc             	mov    -0x4(%ebp),%eax
  1018f3:	0f b6 14 c5 e5 c6 11 	movzbl 0x11c6e5(,%eax,8),%edx
  1018fa:	00 
  1018fb:	80 e2 f0             	and    $0xf0,%dl
  1018fe:	80 ca 0e             	or     $0xe,%dl
  101901:	88 14 c5 e5 c6 11 00 	mov    %dl,0x11c6e5(,%eax,8)
  101908:	8b 45 fc             	mov    -0x4(%ebp),%eax
  10190b:	0f b6 14 c5 e5 c6 11 	movzbl 0x11c6e5(,%eax,8),%edx
  101912:	00 
  101913:	80 e2 ef             	and    $0xef,%dl
  101916:	88 14 c5 e5 c6 11 00 	mov    %dl,0x11c6e5(,%eax,8)
  10191d:	8b 45 fc             	mov    -0x4(%ebp),%eax
  101920:	0f b6 14 c5 e5 c6 11 	movzbl 0x11c6e5(,%eax,8),%edx
  101927:	00 
  101928:	80 e2 9f             	and    $0x9f,%dl
  10192b:	88 14 c5 e5 c6 11 00 	mov    %dl,0x11c6e5(,%eax,8)
  101932:	8b 45 fc             	mov    -0x4(%ebp),%eax
  101935:	0f b6 14 c5 e5 c6 11 	movzbl 0x11c6e5(,%eax,8),%edx
  10193c:	00 
  10193d:	80 ca 80             	or     $0x80,%dl
  101940:	88 14 c5 e5 c6 11 00 	mov    %dl,0x11c6e5(,%eax,8)
  101947:	8b 45 fc             	mov    -0x4(%ebp),%eax
  10194a:	8b 04 85 e0 95 11 00 	mov    0x1195e0(,%eax,4),%eax
  101951:	c1 e8 10             	shr    $0x10,%eax
  101954:	0f b7 d0             	movzwl %ax,%edx
  101957:	8b 45 fc             	mov    -0x4(%ebp),%eax
  10195a:	66 89 14 c5 e6 c6 11 	mov    %dx,0x11c6e6(,%eax,8)
  101961:	00 
    for (i = 0; i < sizeof(idt) / sizeof(struct gatedesc); i ++) {
  101962:	ff 45 fc             	incl   -0x4(%ebp)
  101965:	8b 45 fc             	mov    -0x4(%ebp),%eax
  101968:	3d ff 00 00 00       	cmp    $0xff,%eax
  10196d:	0f 86 2e ff ff ff    	jbe    1018a1 <idt_init+0x12>
    //宏用于配置每个 IDT 条目.0 表示最高特权级（内核级）GD_KTEXT: 指向内核代码段的选择子，确保 ISR 在内核代码段中执行。
	//__vectors[i]: 对应中断的 ISR 地址,DPL_KERNEL: 描述符特权级，表示该中断只能由内核级代码触发。
    // set for switch from user to kernel
    //SETGATE 这行代码特别设置了 T_SWITCH_TOK（一个特定的中断向量，用于用户态到内核态的切换）的 IDT 条目。
    //DPL_USER 表示该中断可以由用户态代码触发
    SETGATE(idt[T_SWITCH_TOK], 0, GD_KTEXT, __vectors[T_SWITCH_TOK], DPL_USER);
  101973:	a1 c4 97 11 00       	mov    0x1197c4,%eax
  101978:	0f b7 c0             	movzwl %ax,%eax
  10197b:	66 a3 a8 ca 11 00    	mov    %ax,0x11caa8
  101981:	66 c7 05 aa ca 11 00 	movw   $0x8,0x11caaa
  101988:	08 00 
  10198a:	0f b6 05 ac ca 11 00 	movzbl 0x11caac,%eax
  101991:	24 e0                	and    $0xe0,%al
  101993:	a2 ac ca 11 00       	mov    %al,0x11caac
  101998:	0f b6 05 ac ca 11 00 	movzbl 0x11caac,%eax
  10199f:	24 1f                	and    $0x1f,%al
  1019a1:	a2 ac ca 11 00       	mov    %al,0x11caac
  1019a6:	0f b6 05 ad ca 11 00 	movzbl 0x11caad,%eax
  1019ad:	24 f0                	and    $0xf0,%al
  1019af:	0c 0e                	or     $0xe,%al
  1019b1:	a2 ad ca 11 00       	mov    %al,0x11caad
  1019b6:	0f b6 05 ad ca 11 00 	movzbl 0x11caad,%eax
  1019bd:	24 ef                	and    $0xef,%al
  1019bf:	a2 ad ca 11 00       	mov    %al,0x11caad
  1019c4:	0f b6 05 ad ca 11 00 	movzbl 0x11caad,%eax
  1019cb:	0c 60                	or     $0x60,%al
  1019cd:	a2 ad ca 11 00       	mov    %al,0x11caad
  1019d2:	0f b6 05 ad ca 11 00 	movzbl 0x11caad,%eax
  1019d9:	0c 80                	or     $0x80,%al
  1019db:	a2 ad ca 11 00       	mov    %al,0x11caad
  1019e0:	a1 c4 97 11 00       	mov    0x1197c4,%eax
  1019e5:	c1 e8 10             	shr    $0x10,%eax
  1019e8:	0f b7 c0             	movzwl %ax,%eax
  1019eb:	66 a3 ae ca 11 00    	mov    %ax,0x11caae
  1019f1:	c7 45 f8 60 95 11 00 	movl   $0x119560,-0x8(%ebp)
    asm volatile ("lidt (%0)" :: "r" (pd) : "memory");
  1019f8:	8b 45 f8             	mov    -0x8(%ebp),%eax
  1019fb:	0f 01 18             	lidtl  (%eax)
}
  1019fe:	90                   	nop
	// load the IDT
    //使用 lidt 指令将 IDT 描述符加载到 CPU 中
    lidt(&idt_pd);
}
  1019ff:	90                   	nop
  101a00:	89 ec                	mov    %ebp,%esp
  101a02:	5d                   	pop    %ebp
  101a03:	c3                   	ret    

00101a04 <trapname>:

static const char *
trapname(int trapno) {
  101a04:	55                   	push   %ebp
  101a05:	89 e5                	mov    %esp,%ebp
        "Alignment Check",
        "Machine-Check",
        "SIMD Floating-Point Exception"
    };

    if (trapno < sizeof(excnames)/sizeof(const char * const)) {
  101a07:	8b 45 08             	mov    0x8(%ebp),%eax
  101a0a:	83 f8 13             	cmp    $0x13,%eax
  101a0d:	77 0c                	ja     101a1b <trapname+0x17>
        return excnames[trapno];
  101a0f:	8b 45 08             	mov    0x8(%ebp),%eax
  101a12:	8b 04 85 80 67 10 00 	mov    0x106780(,%eax,4),%eax
  101a19:	eb 18                	jmp    101a33 <trapname+0x2f>
    }
    if (trapno >= IRQ_OFFSET && trapno < IRQ_OFFSET + 16) {
  101a1b:	83 7d 08 1f          	cmpl   $0x1f,0x8(%ebp)
  101a1f:	7e 0d                	jle    101a2e <trapname+0x2a>
  101a21:	83 7d 08 2f          	cmpl   $0x2f,0x8(%ebp)
  101a25:	7f 07                	jg     101a2e <trapname+0x2a>
        return "Hardware Interrupt";
  101a27:	b8 2a 64 10 00       	mov    $0x10642a,%eax
  101a2c:	eb 05                	jmp    101a33 <trapname+0x2f>
    }
    return "(unknown trap)";
  101a2e:	b8 3d 64 10 00       	mov    $0x10643d,%eax
}
  101a33:	5d                   	pop    %ebp
  101a34:	c3                   	ret    

00101a35 <trap_in_kernel>:

/* trap_in_kernel - test if trap happened in kernel */
bool
trap_in_kernel(struct trapframe *tf) {
  101a35:	55                   	push   %ebp
  101a36:	89 e5                	mov    %esp,%ebp
    return (tf->tf_cs == (uint16_t)KERNEL_CS);
  101a38:	8b 45 08             	mov    0x8(%ebp),%eax
  101a3b:	0f b7 40 3c          	movzwl 0x3c(%eax),%eax
  101a3f:	83 f8 08             	cmp    $0x8,%eax
  101a42:	0f 94 c0             	sete   %al
  101a45:	0f b6 c0             	movzbl %al,%eax
}
  101a48:	5d                   	pop    %ebp
  101a49:	c3                   	ret    

00101a4a <print_trapframe>:
    "TF", "IF", "DF", "OF", NULL, NULL, "NT", NULL,
    "RF", "VM", "AC", "VIF", "VIP", "ID", NULL, NULL,
};

void
print_trapframe(struct trapframe *tf) {
  101a4a:	55                   	push   %ebp
  101a4b:	89 e5                	mov    %esp,%ebp
  101a4d:	83 ec 28             	sub    $0x28,%esp
    cprintf("trapframe at %p\n", tf);
  101a50:	8b 45 08             	mov    0x8(%ebp),%eax
  101a53:	89 44 24 04          	mov    %eax,0x4(%esp)
  101a57:	c7 04 24 7e 64 10 00 	movl   $0x10647e,(%esp)
  101a5e:	e8 03 e9 ff ff       	call   100366 <cprintf>
    print_regs(&tf->tf_regs);
  101a63:	8b 45 08             	mov    0x8(%ebp),%eax
  101a66:	89 04 24             	mov    %eax,(%esp)
  101a69:	e8 8f 01 00 00       	call   101bfd <print_regs>
    cprintf("  ds   0x----%04x\n", tf->tf_ds);
  101a6e:	8b 45 08             	mov    0x8(%ebp),%eax
  101a71:	0f b7 40 2c          	movzwl 0x2c(%eax),%eax
  101a75:	89 44 24 04          	mov    %eax,0x4(%esp)
  101a79:	c7 04 24 8f 64 10 00 	movl   $0x10648f,(%esp)
  101a80:	e8 e1 e8 ff ff       	call   100366 <cprintf>
    cprintf("  es   0x----%04x\n", tf->tf_es);
  101a85:	8b 45 08             	mov    0x8(%ebp),%eax
  101a88:	0f b7 40 28          	movzwl 0x28(%eax),%eax
  101a8c:	89 44 24 04          	mov    %eax,0x4(%esp)
  101a90:	c7 04 24 a2 64 10 00 	movl   $0x1064a2,(%esp)
  101a97:	e8 ca e8 ff ff       	call   100366 <cprintf>
    cprintf("  fs   0x----%04x\n", tf->tf_fs);
  101a9c:	8b 45 08             	mov    0x8(%ebp),%eax
  101a9f:	0f b7 40 24          	movzwl 0x24(%eax),%eax
  101aa3:	89 44 24 04          	mov    %eax,0x4(%esp)
  101aa7:	c7 04 24 b5 64 10 00 	movl   $0x1064b5,(%esp)
  101aae:	e8 b3 e8 ff ff       	call   100366 <cprintf>
    cprintf("  gs   0x----%04x\n", tf->tf_gs);
  101ab3:	8b 45 08             	mov    0x8(%ebp),%eax
  101ab6:	0f b7 40 20          	movzwl 0x20(%eax),%eax
  101aba:	89 44 24 04          	mov    %eax,0x4(%esp)
  101abe:	c7 04 24 c8 64 10 00 	movl   $0x1064c8,(%esp)
  101ac5:	e8 9c e8 ff ff       	call   100366 <cprintf>
    cprintf("  trap 0x%08x %s\n", tf->tf_trapno, trapname(tf->tf_trapno));
  101aca:	8b 45 08             	mov    0x8(%ebp),%eax
  101acd:	8b 40 30             	mov    0x30(%eax),%eax
  101ad0:	89 04 24             	mov    %eax,(%esp)
  101ad3:	e8 2c ff ff ff       	call   101a04 <trapname>
  101ad8:	8b 55 08             	mov    0x8(%ebp),%edx
  101adb:	8b 52 30             	mov    0x30(%edx),%edx
  101ade:	89 44 24 08          	mov    %eax,0x8(%esp)
  101ae2:	89 54 24 04          	mov    %edx,0x4(%esp)
  101ae6:	c7 04 24 db 64 10 00 	movl   $0x1064db,(%esp)
  101aed:	e8 74 e8 ff ff       	call   100366 <cprintf>
    cprintf("  err  0x%08x\n", tf->tf_err);
  101af2:	8b 45 08             	mov    0x8(%ebp),%eax
  101af5:	8b 40 34             	mov    0x34(%eax),%eax
  101af8:	89 44 24 04          	mov    %eax,0x4(%esp)
  101afc:	c7 04 24 ed 64 10 00 	movl   $0x1064ed,(%esp)
  101b03:	e8 5e e8 ff ff       	call   100366 <cprintf>
    cprintf("  eip  0x%08x\n", tf->tf_eip);
  101b08:	8b 45 08             	mov    0x8(%ebp),%eax
  101b0b:	8b 40 38             	mov    0x38(%eax),%eax
  101b0e:	89 44 24 04          	mov    %eax,0x4(%esp)
  101b12:	c7 04 24 fc 64 10 00 	movl   $0x1064fc,(%esp)
  101b19:	e8 48 e8 ff ff       	call   100366 <cprintf>
    cprintf("  cs   0x----%04x\n", tf->tf_cs);
  101b1e:	8b 45 08             	mov    0x8(%ebp),%eax
  101b21:	0f b7 40 3c          	movzwl 0x3c(%eax),%eax
  101b25:	89 44 24 04          	mov    %eax,0x4(%esp)
  101b29:	c7 04 24 0b 65 10 00 	movl   $0x10650b,(%esp)
  101b30:	e8 31 e8 ff ff       	call   100366 <cprintf>
    cprintf("  flag 0x%08x ", tf->tf_eflags);
  101b35:	8b 45 08             	mov    0x8(%ebp),%eax
  101b38:	8b 40 40             	mov    0x40(%eax),%eax
  101b3b:	89 44 24 04          	mov    %eax,0x4(%esp)
  101b3f:	c7 04 24 1e 65 10 00 	movl   $0x10651e,(%esp)
  101b46:	e8 1b e8 ff ff       	call   100366 <cprintf>

    int i, j;
    for (i = 0, j = 1; i < sizeof(IA32flags) / sizeof(IA32flags[0]); i ++, j <<= 1) {
  101b4b:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
  101b52:	c7 45 f0 01 00 00 00 	movl   $0x1,-0x10(%ebp)
  101b59:	eb 3d                	jmp    101b98 <print_trapframe+0x14e>
        if ((tf->tf_eflags & j) && IA32flags[i] != NULL) {
  101b5b:	8b 45 08             	mov    0x8(%ebp),%eax
  101b5e:	8b 50 40             	mov    0x40(%eax),%edx
  101b61:	8b 45 f0             	mov    -0x10(%ebp),%eax
  101b64:	21 d0                	and    %edx,%eax
  101b66:	85 c0                	test   %eax,%eax
  101b68:	74 28                	je     101b92 <print_trapframe+0x148>
  101b6a:	8b 45 f4             	mov    -0xc(%ebp),%eax
  101b6d:	8b 04 85 80 95 11 00 	mov    0x119580(,%eax,4),%eax
  101b74:	85 c0                	test   %eax,%eax
  101b76:	74 1a                	je     101b92 <print_trapframe+0x148>
            cprintf("%s,", IA32flags[i]);
  101b78:	8b 45 f4             	mov    -0xc(%ebp),%eax
  101b7b:	8b 04 85 80 95 11 00 	mov    0x119580(,%eax,4),%eax
  101b82:	89 44 24 04          	mov    %eax,0x4(%esp)
  101b86:	c7 04 24 2d 65 10 00 	movl   $0x10652d,(%esp)
  101b8d:	e8 d4 e7 ff ff       	call   100366 <cprintf>
    for (i = 0, j = 1; i < sizeof(IA32flags) / sizeof(IA32flags[0]); i ++, j <<= 1) {
  101b92:	ff 45 f4             	incl   -0xc(%ebp)
  101b95:	d1 65 f0             	shll   -0x10(%ebp)
  101b98:	8b 45 f4             	mov    -0xc(%ebp),%eax
  101b9b:	83 f8 17             	cmp    $0x17,%eax
  101b9e:	76 bb                	jbe    101b5b <print_trapframe+0x111>
        }
    }
    cprintf("IOPL=%d\n", (tf->tf_eflags & FL_IOPL_MASK) >> 12);
  101ba0:	8b 45 08             	mov    0x8(%ebp),%eax
  101ba3:	8b 40 40             	mov    0x40(%eax),%eax
  101ba6:	c1 e8 0c             	shr    $0xc,%eax
  101ba9:	83 e0 03             	and    $0x3,%eax
  101bac:	89 44 24 04          	mov    %eax,0x4(%esp)
  101bb0:	c7 04 24 31 65 10 00 	movl   $0x106531,(%esp)
  101bb7:	e8 aa e7 ff ff       	call   100366 <cprintf>

    if (!trap_in_kernel(tf)) {
  101bbc:	8b 45 08             	mov    0x8(%ebp),%eax
  101bbf:	89 04 24             	mov    %eax,(%esp)
  101bc2:	e8 6e fe ff ff       	call   101a35 <trap_in_kernel>
  101bc7:	85 c0                	test   %eax,%eax
  101bc9:	75 2d                	jne    101bf8 <print_trapframe+0x1ae>
        cprintf("  esp  0x%08x\n", tf->tf_esp);
  101bcb:	8b 45 08             	mov    0x8(%ebp),%eax
  101bce:	8b 40 44             	mov    0x44(%eax),%eax
  101bd1:	89 44 24 04          	mov    %eax,0x4(%esp)
  101bd5:	c7 04 24 3a 65 10 00 	movl   $0x10653a,(%esp)
  101bdc:	e8 85 e7 ff ff       	call   100366 <cprintf>
        cprintf("  ss   0x----%04x\n", tf->tf_ss);
  101be1:	8b 45 08             	mov    0x8(%ebp),%eax
  101be4:	0f b7 40 48          	movzwl 0x48(%eax),%eax
  101be8:	89 44 24 04          	mov    %eax,0x4(%esp)
  101bec:	c7 04 24 49 65 10 00 	movl   $0x106549,(%esp)
  101bf3:	e8 6e e7 ff ff       	call   100366 <cprintf>
    }
}
  101bf8:	90                   	nop
  101bf9:	89 ec                	mov    %ebp,%esp
  101bfb:	5d                   	pop    %ebp
  101bfc:	c3                   	ret    

00101bfd <print_regs>:

void
print_regs(struct pushregs *regs) {
  101bfd:	55                   	push   %ebp
  101bfe:	89 e5                	mov    %esp,%ebp
  101c00:	83 ec 18             	sub    $0x18,%esp
    cprintf("  edi  0x%08x\n", regs->reg_edi);
  101c03:	8b 45 08             	mov    0x8(%ebp),%eax
  101c06:	8b 00                	mov    (%eax),%eax
  101c08:	89 44 24 04          	mov    %eax,0x4(%esp)
  101c0c:	c7 04 24 5c 65 10 00 	movl   $0x10655c,(%esp)
  101c13:	e8 4e e7 ff ff       	call   100366 <cprintf>
    cprintf("  esi  0x%08x\n", regs->reg_esi);
  101c18:	8b 45 08             	mov    0x8(%ebp),%eax
  101c1b:	8b 40 04             	mov    0x4(%eax),%eax
  101c1e:	89 44 24 04          	mov    %eax,0x4(%esp)
  101c22:	c7 04 24 6b 65 10 00 	movl   $0x10656b,(%esp)
  101c29:	e8 38 e7 ff ff       	call   100366 <cprintf>
    cprintf("  ebp  0x%08x\n", regs->reg_ebp);
  101c2e:	8b 45 08             	mov    0x8(%ebp),%eax
  101c31:	8b 40 08             	mov    0x8(%eax),%eax
  101c34:	89 44 24 04          	mov    %eax,0x4(%esp)
  101c38:	c7 04 24 7a 65 10 00 	movl   $0x10657a,(%esp)
  101c3f:	e8 22 e7 ff ff       	call   100366 <cprintf>
    cprintf("  oesp 0x%08x\n", regs->reg_oesp);
  101c44:	8b 45 08             	mov    0x8(%ebp),%eax
  101c47:	8b 40 0c             	mov    0xc(%eax),%eax
  101c4a:	89 44 24 04          	mov    %eax,0x4(%esp)
  101c4e:	c7 04 24 89 65 10 00 	movl   $0x106589,(%esp)
  101c55:	e8 0c e7 ff ff       	call   100366 <cprintf>
    cprintf("  ebx  0x%08x\n", regs->reg_ebx);
  101c5a:	8b 45 08             	mov    0x8(%ebp),%eax
  101c5d:	8b 40 10             	mov    0x10(%eax),%eax
  101c60:	89 44 24 04          	mov    %eax,0x4(%esp)
  101c64:	c7 04 24 98 65 10 00 	movl   $0x106598,(%esp)
  101c6b:	e8 f6 e6 ff ff       	call   100366 <cprintf>
    cprintf("  edx  0x%08x\n", regs->reg_edx);
  101c70:	8b 45 08             	mov    0x8(%ebp),%eax
  101c73:	8b 40 14             	mov    0x14(%eax),%eax
  101c76:	89 44 24 04          	mov    %eax,0x4(%esp)
  101c7a:	c7 04 24 a7 65 10 00 	movl   $0x1065a7,(%esp)
  101c81:	e8 e0 e6 ff ff       	call   100366 <cprintf>
    cprintf("  ecx  0x%08x\n", regs->reg_ecx);
  101c86:	8b 45 08             	mov    0x8(%ebp),%eax
  101c89:	8b 40 18             	mov    0x18(%eax),%eax
  101c8c:	89 44 24 04          	mov    %eax,0x4(%esp)
  101c90:	c7 04 24 b6 65 10 00 	movl   $0x1065b6,(%esp)
  101c97:	e8 ca e6 ff ff       	call   100366 <cprintf>
    cprintf("  eax  0x%08x\n", regs->reg_eax);
  101c9c:	8b 45 08             	mov    0x8(%ebp),%eax
  101c9f:	8b 40 1c             	mov    0x1c(%eax),%eax
  101ca2:	89 44 24 04          	mov    %eax,0x4(%esp)
  101ca6:	c7 04 24 c5 65 10 00 	movl   $0x1065c5,(%esp)
  101cad:	e8 b4 e6 ff ff       	call   100366 <cprintf>
}
  101cb2:	90                   	nop
  101cb3:	89 ec                	mov    %ebp,%esp
  101cb5:	5d                   	pop    %ebp
  101cb6:	c3                   	ret    

00101cb7 <trap_dispatch>:

struct trapframe switchk2u, *switchu2k;
/* trap_dispatch - dispatch based on what type of trap occurred */
static void
trap_dispatch(struct trapframe *tf) {
  101cb7:	55                   	push   %ebp
  101cb8:	89 e5                	mov    %esp,%ebp
  101cba:	83 ec 28             	sub    $0x28,%esp
  101cbd:	89 5d fc             	mov    %ebx,-0x4(%ebp)
    char c;

    switch (tf->tf_trapno) {
  101cc0:	8b 45 08             	mov    0x8(%ebp),%eax
  101cc3:	8b 40 30             	mov    0x30(%eax),%eax
  101cc6:	83 f8 79             	cmp    $0x79,%eax
  101cc9:	0f 84 6c 01 00 00    	je     101e3b <trap_dispatch+0x184>
  101ccf:	83 f8 79             	cmp    $0x79,%eax
  101cd2:	0f 87 e0 01 00 00    	ja     101eb8 <trap_dispatch+0x201>
  101cd8:	83 f8 78             	cmp    $0x78,%eax
  101cdb:	0f 84 d0 00 00 00    	je     101db1 <trap_dispatch+0xfa>
  101ce1:	83 f8 78             	cmp    $0x78,%eax
  101ce4:	0f 87 ce 01 00 00    	ja     101eb8 <trap_dispatch+0x201>
  101cea:	83 f8 2f             	cmp    $0x2f,%eax
  101ced:	0f 87 c5 01 00 00    	ja     101eb8 <trap_dispatch+0x201>
  101cf3:	83 f8 2e             	cmp    $0x2e,%eax
  101cf6:	0f 83 f1 01 00 00    	jae    101eed <trap_dispatch+0x236>
  101cfc:	83 f8 24             	cmp    $0x24,%eax
  101cff:	74 5e                	je     101d5f <trap_dispatch+0xa8>
  101d01:	83 f8 24             	cmp    $0x24,%eax
  101d04:	0f 87 ae 01 00 00    	ja     101eb8 <trap_dispatch+0x201>
  101d0a:	83 f8 20             	cmp    $0x20,%eax
  101d0d:	74 0a                	je     101d19 <trap_dispatch+0x62>
  101d0f:	83 f8 21             	cmp    $0x21,%eax
  101d12:	74 74                	je     101d88 <trap_dispatch+0xd1>
  101d14:	e9 9f 01 00 00       	jmp    101eb8 <trap_dispatch+0x201>
        /* handle the timer interrupt */
        /* (1) After a timer interrupt, you should record this event using a global variable (increase it), such as ticks in kern/driver/clock.c
         * (2) Every TICK_NUM cycle, you can print some info using a funciton, such as print_ticks().
         * (3) Too Simple? Yes, I think so!
         */
        ticks ++; //记录中断事件
  101d19:	a1 24 c4 11 00       	mov    0x11c424,%eax
  101d1e:	40                   	inc    %eax
  101d1f:	a3 24 c4 11 00       	mov    %eax,0x11c424
        if (ticks % TICK_NUM == 0)
  101d24:	8b 0d 24 c4 11 00    	mov    0x11c424,%ecx
  101d2a:	ba 1f 85 eb 51       	mov    $0x51eb851f,%edx
  101d2f:	89 c8                	mov    %ecx,%eax
  101d31:	f7 e2                	mul    %edx
  101d33:	c1 ea 05             	shr    $0x5,%edx
  101d36:	89 d0                	mov    %edx,%eax
  101d38:	c1 e0 02             	shl    $0x2,%eax
  101d3b:	01 d0                	add    %edx,%eax
  101d3d:	8d 14 85 00 00 00 00 	lea    0x0(,%eax,4),%edx
  101d44:	01 d0                	add    %edx,%eax
  101d46:	c1 e0 02             	shl    $0x2,%eax
  101d49:	29 c1                	sub    %eax,%ecx
  101d4b:	89 ca                	mov    %ecx,%edx
  101d4d:	85 d2                	test   %edx,%edx
  101d4f:	0f 85 9b 01 00 00    	jne    101ef0 <trap_dispatch+0x239>
        {
            print_ticks();
  101d55:	e8 16 fb ff ff       	call   101870 <print_ticks>
        }//每经过 TICK_NUM 次周期时，调用 print_ticks() 打印信息。
        break;
  101d5a:	e9 91 01 00 00       	jmp    101ef0 <trap_dispatch+0x239>
    case IRQ_OFFSET + IRQ_COM1:
        c = cons_getc();
  101d5f:	e8 af f8 ff ff       	call   101613 <cons_getc>
  101d64:	88 45 f7             	mov    %al,-0x9(%ebp)
        cprintf("serial [%03d] %c\n", c, c);
  101d67:	0f be 55 f7          	movsbl -0x9(%ebp),%edx
  101d6b:	0f be 45 f7          	movsbl -0x9(%ebp),%eax
  101d6f:	89 54 24 08          	mov    %edx,0x8(%esp)
  101d73:	89 44 24 04          	mov    %eax,0x4(%esp)
  101d77:	c7 04 24 d4 65 10 00 	movl   $0x1065d4,(%esp)
  101d7e:	e8 e3 e5 ff ff       	call   100366 <cprintf>
        break;
  101d83:	e9 6f 01 00 00       	jmp    101ef7 <trap_dispatch+0x240>
    case IRQ_OFFSET + IRQ_KBD:
        c = cons_getc();
  101d88:	e8 86 f8 ff ff       	call   101613 <cons_getc>
  101d8d:	88 45 f7             	mov    %al,-0x9(%ebp)
        cprintf("kbd [%03d] %c\n", c, c);
  101d90:	0f be 55 f7          	movsbl -0x9(%ebp),%edx
  101d94:	0f be 45 f7          	movsbl -0x9(%ebp),%eax
  101d98:	89 54 24 08          	mov    %edx,0x8(%esp)
  101d9c:	89 44 24 04          	mov    %eax,0x4(%esp)
  101da0:	c7 04 24 e6 65 10 00 	movl   $0x1065e6,(%esp)
  101da7:	e8 ba e5 ff ff       	call   100366 <cprintf>
        break;
  101dac:	e9 46 01 00 00       	jmp    101ef7 <trap_dispatch+0x240>
    //LAB1 CHALLENGE 1 : YOUR CODE you should modify below codes.
    case T_SWITCH_TOU://表示发生了从内核模式切换到用户模式的请求。
        if (tf->tf_cs != USER_CS) {//判断当前是否在内核模式下
  101db1:	8b 45 08             	mov    0x8(%ebp),%eax
  101db4:	0f b7 40 3c          	movzwl 0x3c(%eax),%eax
  101db8:	83 f8 1b             	cmp    $0x1b,%eax
  101dbb:	0f 84 32 01 00 00    	je     101ef3 <trap_dispatch+0x23c>
            switchk2u = *tf; //保存当前陷阱框架
  101dc1:	8b 4d 08             	mov    0x8(%ebp),%ecx
  101dc4:	b8 4c 00 00 00       	mov    $0x4c,%eax
  101dc9:	83 e0 fc             	and    $0xfffffffc,%eax
  101dcc:	89 c3                	mov    %eax,%ebx
  101dce:	b8 00 00 00 00       	mov    $0x0,%eax
  101dd3:	8b 14 01             	mov    (%ecx,%eax,1),%edx
  101dd6:	89 90 80 c6 11 00    	mov    %edx,0x11c680(%eax)
  101ddc:	83 c0 04             	add    $0x4,%eax
  101ddf:	39 d8                	cmp    %ebx,%eax
  101de1:	72 f0                	jb     101dd3 <trap_dispatch+0x11c>
            switchk2u.tf_cs = USER_CS;//设置用户模式的段寄存器
  101de3:	66 c7 05 bc c6 11 00 	movw   $0x1b,0x11c6bc
  101dea:	1b 00 
            //将数据段和栈段寄存器 都设置为 USER_DS（用户数据段）
            switchk2u.tf_ds = switchk2u.tf_es = switchk2u.tf_ss = USER_DS;
  101dec:	66 c7 05 c8 c6 11 00 	movw   $0x23,0x11c6c8
  101df3:	23 00 
  101df5:	0f b7 05 c8 c6 11 00 	movzwl 0x11c6c8,%eax
  101dfc:	66 a3 a8 c6 11 00    	mov    %ax,0x11c6a8
  101e02:	0f b7 05 a8 c6 11 00 	movzwl 0x11c6a8,%eax
  101e09:	66 a3 ac c6 11 00    	mov    %ax,0x11c6ac
            switchk2u.tf_esp = (uint32_t)tf + sizeof(struct trapframe) - 8;
  101e0f:	8b 45 08             	mov    0x8(%ebp),%eax
  101e12:	83 c0 44             	add    $0x44,%eax
  101e15:	a3 c4 c6 11 00       	mov    %eax,0x11c6c4
        
            // set eflags, make sure ucore can use io under user mode.
            // if CPL > IOPL, then cpu will generate a general protection.
            switchk2u.tf_eflags |= FL_IOPL_MASK;//允许用户模式下进行 I/O 操作
  101e1a:	a1 c0 c6 11 00       	mov    0x11c6c0,%eax
  101e1f:	0d 00 30 00 00       	or     $0x3000,%eax
  101e24:	a3 c0 c6 11 00       	mov    %eax,0x11c6c0
        
            // set temporary stack
            // then iret will jump to the right stack
            *((uint32_t *)tf - 1) = (uint32_t)&switchk2u;
  101e29:	8b 45 08             	mov    0x8(%ebp),%eax
  101e2c:	83 e8 04             	sub    $0x4,%eax
  101e2f:	ba 80 c6 11 00       	mov    $0x11c680,%edx
  101e34:	89 10                	mov    %edx,(%eax)
        }
        break;
  101e36:	e9 b8 00 00 00       	jmp    101ef3 <trap_dispatch+0x23c>
    case T_SWITCH_TOK: // T_SWITCH_TOK 表示发生了从用户模式切换到内核模式的请求。
        if (tf->tf_cs != KERNEL_CS) { //判断当前是否在用户模式下
  101e3b:	8b 45 08             	mov    0x8(%ebp),%eax
  101e3e:	0f b7 40 3c          	movzwl 0x3c(%eax),%eax
  101e42:	83 f8 08             	cmp    $0x8,%eax
  101e45:	0f 84 ab 00 00 00    	je     101ef6 <trap_dispatch+0x23f>
            tf->tf_cs = KERNEL_CS;
  101e4b:	8b 45 08             	mov    0x8(%ebp),%eax
  101e4e:	66 c7 40 3c 08 00    	movw   $0x8,0x3c(%eax)
            tf->tf_ds = tf->tf_es = KERNEL_DS;
  101e54:	8b 45 08             	mov    0x8(%ebp),%eax
  101e57:	66 c7 40 28 10 00    	movw   $0x10,0x28(%eax)
  101e5d:	8b 45 08             	mov    0x8(%ebp),%eax
  101e60:	0f b7 50 28          	movzwl 0x28(%eax),%edx
  101e64:	8b 45 08             	mov    0x8(%ebp),%eax
  101e67:	66 89 50 2c          	mov    %dx,0x2c(%eax)
            //设置内核模式的段寄存器
            tf->tf_eflags &= ~FL_IOPL_MASK; //清除 I/O 权限标志
  101e6b:	8b 45 08             	mov    0x8(%ebp),%eax
  101e6e:	8b 40 40             	mov    0x40(%eax),%eax
  101e71:	25 ff cf ff ff       	and    $0xffffcfff,%eax
  101e76:	89 c2                	mov    %eax,%edx
  101e78:	8b 45 08             	mov    0x8(%ebp),%eax
  101e7b:	89 50 40             	mov    %edx,0x40(%eax)
            switchu2k = (struct trapframe *)(tf->tf_esp - (sizeof(struct trapframe) - 8));
  101e7e:	8b 45 08             	mov    0x8(%ebp),%eax
  101e81:	8b 40 44             	mov    0x44(%eax),%eax
  101e84:	83 e8 44             	sub    $0x44,%eax
  101e87:	a3 cc c6 11 00       	mov    %eax,0x11c6cc
            //使用 memmove 将当前的陷阱框架（除了最后8个字节）复制到新的陷阱框架位置 switchu2k
            memmove(switchu2k, tf, sizeof(struct trapframe) - 8);
  101e8c:	a1 cc c6 11 00       	mov    0x11c6cc,%eax
  101e91:	c7 44 24 08 44 00 00 	movl   $0x44,0x8(%esp)
  101e98:	00 
  101e99:	8b 55 08             	mov    0x8(%ebp),%edx
  101e9c:	89 54 24 04          	mov    %edx,0x4(%esp)
  101ea0:	89 04 24             	mov    %eax,(%esp)
  101ea3:	e8 e8 40 00 00       	call   105f90 <memmove>
            //将新的陷阱框架地址 switchu2k 存储到当前陷阱框架之前的一个栈位置
            *((uint32_t *)tf - 1) = (uint32_t)switchu2k;
  101ea8:	8b 15 cc c6 11 00    	mov    0x11c6cc,%edx
  101eae:	8b 45 08             	mov    0x8(%ebp),%eax
  101eb1:	83 e8 04             	sub    $0x4,%eax
  101eb4:	89 10                	mov    %edx,(%eax)
        }
        break;
  101eb6:	eb 3e                	jmp    101ef6 <trap_dispatch+0x23f>
    case IRQ_OFFSET + IRQ_IDE2:
        /* do nothing */
        break;
    default:
        // in kernel, it must be a mistake
        if ((tf->tf_cs & 3) == 0) {
  101eb8:	8b 45 08             	mov    0x8(%ebp),%eax
  101ebb:	0f b7 40 3c          	movzwl 0x3c(%eax),%eax
  101ebf:	83 e0 03             	and    $0x3,%eax
  101ec2:	85 c0                	test   %eax,%eax
  101ec4:	75 31                	jne    101ef7 <trap_dispatch+0x240>
            print_trapframe(tf);
  101ec6:	8b 45 08             	mov    0x8(%ebp),%eax
  101ec9:	89 04 24             	mov    %eax,(%esp)
  101ecc:	e8 79 fb ff ff       	call   101a4a <print_trapframe>
            panic("unexpected trap in kernel.\n");
  101ed1:	c7 44 24 08 f5 65 10 	movl   $0x1065f5,0x8(%esp)
  101ed8:	00 
  101ed9:	c7 44 24 04 dc 00 00 	movl   $0xdc,0x4(%esp)
  101ee0:	00 
  101ee1:	c7 04 24 11 66 10 00 	movl   $0x106611,(%esp)
  101ee8:	e8 46 ed ff ff       	call   100c33 <__panic>
        break;
  101eed:	90                   	nop
  101eee:	eb 07                	jmp    101ef7 <trap_dispatch+0x240>
        break;
  101ef0:	90                   	nop
  101ef1:	eb 04                	jmp    101ef7 <trap_dispatch+0x240>
        break;
  101ef3:	90                   	nop
  101ef4:	eb 01                	jmp    101ef7 <trap_dispatch+0x240>
        break;
  101ef6:	90                   	nop
        }
    }
}
  101ef7:	90                   	nop
  101ef8:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  101efb:	89 ec                	mov    %ebp,%esp
  101efd:	5d                   	pop    %ebp
  101efe:	c3                   	ret    

00101eff <trap>:
 * trap - handles or dispatches an exception/interrupt. if and when trap() returns,
 * the code in kern/trap/trapentry.S restores the old CPU state saved in the
 * trapframe and then uses the iret instruction to return from the exception.
 * */
void
trap(struct trapframe *tf) {
  101eff:	55                   	push   %ebp
  101f00:	89 e5                	mov    %esp,%ebp
  101f02:	83 ec 18             	sub    $0x18,%esp
    // dispatch based on what type of trap occurred
    trap_dispatch(tf);
  101f05:	8b 45 08             	mov    0x8(%ebp),%eax
  101f08:	89 04 24             	mov    %eax,(%esp)
  101f0b:	e8 a7 fd ff ff       	call   101cb7 <trap_dispatch>
}
  101f10:	90                   	nop
  101f11:	89 ec                	mov    %ebp,%esp
  101f13:	5d                   	pop    %ebp
  101f14:	c3                   	ret    

00101f15 <__alltraps>:
.text
.globl __alltraps
__alltraps:
    # push registers to build a trap frame
    # therefore make the stack look like a struct trapframe
    pushl %ds
  101f15:	1e                   	push   %ds
    pushl %es
  101f16:	06                   	push   %es
    pushl %fs
  101f17:	0f a0                	push   %fs
    pushl %gs
  101f19:	0f a8                	push   %gs
    pushal
  101f1b:	60                   	pusha  

    # load GD_KDATA into %ds and %es to set up data segments for kernel
    movl $GD_KDATA, %eax
  101f1c:	b8 10 00 00 00       	mov    $0x10,%eax
    movw %ax, %ds
  101f21:	8e d8                	mov    %eax,%ds
    movw %ax, %es
  101f23:	8e c0                	mov    %eax,%es

    # push %esp to pass a pointer to the trapframe as an argument to trap()
    pushl %esp
  101f25:	54                   	push   %esp

    # call trap(tf), where tf=%esp
    call trap
  101f26:	e8 d4 ff ff ff       	call   101eff <trap>

    # pop the pushed stack pointer
    popl %esp
  101f2b:	5c                   	pop    %esp

00101f2c <__trapret>:

    # return falls through to trapret...
.globl __trapret
__trapret:
    # restore registers from stack
    popal
  101f2c:	61                   	popa   

    # restore %ds, %es, %fs and %gs
    popl %gs
  101f2d:	0f a9                	pop    %gs
    popl %fs
  101f2f:	0f a1                	pop    %fs
    popl %es
  101f31:	07                   	pop    %es
    popl %ds
  101f32:	1f                   	pop    %ds

    # get rid of the trap number and error code
    addl $0x8, %esp
  101f33:	83 c4 08             	add    $0x8,%esp
    iret
  101f36:	cf                   	iret   

00101f37 <vector0>:
# handler
.text
.globl __alltraps
.globl vector0
vector0:
  pushl $0
  101f37:	6a 00                	push   $0x0
  pushl $0
  101f39:	6a 00                	push   $0x0
  jmp __alltraps
  101f3b:	e9 d5 ff ff ff       	jmp    101f15 <__alltraps>

00101f40 <vector1>:
.globl vector1
vector1:
  pushl $0
  101f40:	6a 00                	push   $0x0
  pushl $1
  101f42:	6a 01                	push   $0x1
  jmp __alltraps
  101f44:	e9 cc ff ff ff       	jmp    101f15 <__alltraps>

00101f49 <vector2>:
.globl vector2
vector2:
  pushl $0
  101f49:	6a 00                	push   $0x0
  pushl $2
  101f4b:	6a 02                	push   $0x2
  jmp __alltraps
  101f4d:	e9 c3 ff ff ff       	jmp    101f15 <__alltraps>

00101f52 <vector3>:
.globl vector3
vector3:
  pushl $0
  101f52:	6a 00                	push   $0x0
  pushl $3
  101f54:	6a 03                	push   $0x3
  jmp __alltraps
  101f56:	e9 ba ff ff ff       	jmp    101f15 <__alltraps>

00101f5b <vector4>:
.globl vector4
vector4:
  pushl $0
  101f5b:	6a 00                	push   $0x0
  pushl $4
  101f5d:	6a 04                	push   $0x4
  jmp __alltraps
  101f5f:	e9 b1 ff ff ff       	jmp    101f15 <__alltraps>

00101f64 <vector5>:
.globl vector5
vector5:
  pushl $0
  101f64:	6a 00                	push   $0x0
  pushl $5
  101f66:	6a 05                	push   $0x5
  jmp __alltraps
  101f68:	e9 a8 ff ff ff       	jmp    101f15 <__alltraps>

00101f6d <vector6>:
.globl vector6
vector6:
  pushl $0
  101f6d:	6a 00                	push   $0x0
  pushl $6
  101f6f:	6a 06                	push   $0x6
  jmp __alltraps
  101f71:	e9 9f ff ff ff       	jmp    101f15 <__alltraps>

00101f76 <vector7>:
.globl vector7
vector7:
  pushl $0
  101f76:	6a 00                	push   $0x0
  pushl $7
  101f78:	6a 07                	push   $0x7
  jmp __alltraps
  101f7a:	e9 96 ff ff ff       	jmp    101f15 <__alltraps>

00101f7f <vector8>:
.globl vector8
vector8:
  pushl $8
  101f7f:	6a 08                	push   $0x8
  jmp __alltraps
  101f81:	e9 8f ff ff ff       	jmp    101f15 <__alltraps>

00101f86 <vector9>:
.globl vector9
vector9:
  pushl $0
  101f86:	6a 00                	push   $0x0
  pushl $9
  101f88:	6a 09                	push   $0x9
  jmp __alltraps
  101f8a:	e9 86 ff ff ff       	jmp    101f15 <__alltraps>

00101f8f <vector10>:
.globl vector10
vector10:
  pushl $10
  101f8f:	6a 0a                	push   $0xa
  jmp __alltraps
  101f91:	e9 7f ff ff ff       	jmp    101f15 <__alltraps>

00101f96 <vector11>:
.globl vector11
vector11:
  pushl $11
  101f96:	6a 0b                	push   $0xb
  jmp __alltraps
  101f98:	e9 78 ff ff ff       	jmp    101f15 <__alltraps>

00101f9d <vector12>:
.globl vector12
vector12:
  pushl $12
  101f9d:	6a 0c                	push   $0xc
  jmp __alltraps
  101f9f:	e9 71 ff ff ff       	jmp    101f15 <__alltraps>

00101fa4 <vector13>:
.globl vector13
vector13:
  pushl $13
  101fa4:	6a 0d                	push   $0xd
  jmp __alltraps
  101fa6:	e9 6a ff ff ff       	jmp    101f15 <__alltraps>

00101fab <vector14>:
.globl vector14
vector14:
  pushl $14
  101fab:	6a 0e                	push   $0xe
  jmp __alltraps
  101fad:	e9 63 ff ff ff       	jmp    101f15 <__alltraps>

00101fb2 <vector15>:
.globl vector15
vector15:
  pushl $0
  101fb2:	6a 00                	push   $0x0
  pushl $15
  101fb4:	6a 0f                	push   $0xf
  jmp __alltraps
  101fb6:	e9 5a ff ff ff       	jmp    101f15 <__alltraps>

00101fbb <vector16>:
.globl vector16
vector16:
  pushl $0
  101fbb:	6a 00                	push   $0x0
  pushl $16
  101fbd:	6a 10                	push   $0x10
  jmp __alltraps
  101fbf:	e9 51 ff ff ff       	jmp    101f15 <__alltraps>

00101fc4 <vector17>:
.globl vector17
vector17:
  pushl $17
  101fc4:	6a 11                	push   $0x11
  jmp __alltraps
  101fc6:	e9 4a ff ff ff       	jmp    101f15 <__alltraps>

00101fcb <vector18>:
.globl vector18
vector18:
  pushl $0
  101fcb:	6a 00                	push   $0x0
  pushl $18
  101fcd:	6a 12                	push   $0x12
  jmp __alltraps
  101fcf:	e9 41 ff ff ff       	jmp    101f15 <__alltraps>

00101fd4 <vector19>:
.globl vector19
vector19:
  pushl $0
  101fd4:	6a 00                	push   $0x0
  pushl $19
  101fd6:	6a 13                	push   $0x13
  jmp __alltraps
  101fd8:	e9 38 ff ff ff       	jmp    101f15 <__alltraps>

00101fdd <vector20>:
.globl vector20
vector20:
  pushl $0
  101fdd:	6a 00                	push   $0x0
  pushl $20
  101fdf:	6a 14                	push   $0x14
  jmp __alltraps
  101fe1:	e9 2f ff ff ff       	jmp    101f15 <__alltraps>

00101fe6 <vector21>:
.globl vector21
vector21:
  pushl $0
  101fe6:	6a 00                	push   $0x0
  pushl $21
  101fe8:	6a 15                	push   $0x15
  jmp __alltraps
  101fea:	e9 26 ff ff ff       	jmp    101f15 <__alltraps>

00101fef <vector22>:
.globl vector22
vector22:
  pushl $0
  101fef:	6a 00                	push   $0x0
  pushl $22
  101ff1:	6a 16                	push   $0x16
  jmp __alltraps
  101ff3:	e9 1d ff ff ff       	jmp    101f15 <__alltraps>

00101ff8 <vector23>:
.globl vector23
vector23:
  pushl $0
  101ff8:	6a 00                	push   $0x0
  pushl $23
  101ffa:	6a 17                	push   $0x17
  jmp __alltraps
  101ffc:	e9 14 ff ff ff       	jmp    101f15 <__alltraps>

00102001 <vector24>:
.globl vector24
vector24:
  pushl $0
  102001:	6a 00                	push   $0x0
  pushl $24
  102003:	6a 18                	push   $0x18
  jmp __alltraps
  102005:	e9 0b ff ff ff       	jmp    101f15 <__alltraps>

0010200a <vector25>:
.globl vector25
vector25:
  pushl $0
  10200a:	6a 00                	push   $0x0
  pushl $25
  10200c:	6a 19                	push   $0x19
  jmp __alltraps
  10200e:	e9 02 ff ff ff       	jmp    101f15 <__alltraps>

00102013 <vector26>:
.globl vector26
vector26:
  pushl $0
  102013:	6a 00                	push   $0x0
  pushl $26
  102015:	6a 1a                	push   $0x1a
  jmp __alltraps
  102017:	e9 f9 fe ff ff       	jmp    101f15 <__alltraps>

0010201c <vector27>:
.globl vector27
vector27:
  pushl $0
  10201c:	6a 00                	push   $0x0
  pushl $27
  10201e:	6a 1b                	push   $0x1b
  jmp __alltraps
  102020:	e9 f0 fe ff ff       	jmp    101f15 <__alltraps>

00102025 <vector28>:
.globl vector28
vector28:
  pushl $0
  102025:	6a 00                	push   $0x0
  pushl $28
  102027:	6a 1c                	push   $0x1c
  jmp __alltraps
  102029:	e9 e7 fe ff ff       	jmp    101f15 <__alltraps>

0010202e <vector29>:
.globl vector29
vector29:
  pushl $0
  10202e:	6a 00                	push   $0x0
  pushl $29
  102030:	6a 1d                	push   $0x1d
  jmp __alltraps
  102032:	e9 de fe ff ff       	jmp    101f15 <__alltraps>

00102037 <vector30>:
.globl vector30
vector30:
  pushl $0
  102037:	6a 00                	push   $0x0
  pushl $30
  102039:	6a 1e                	push   $0x1e
  jmp __alltraps
  10203b:	e9 d5 fe ff ff       	jmp    101f15 <__alltraps>

00102040 <vector31>:
.globl vector31
vector31:
  pushl $0
  102040:	6a 00                	push   $0x0
  pushl $31
  102042:	6a 1f                	push   $0x1f
  jmp __alltraps
  102044:	e9 cc fe ff ff       	jmp    101f15 <__alltraps>

00102049 <vector32>:
.globl vector32
vector32:
  pushl $0
  102049:	6a 00                	push   $0x0
  pushl $32
  10204b:	6a 20                	push   $0x20
  jmp __alltraps
  10204d:	e9 c3 fe ff ff       	jmp    101f15 <__alltraps>

00102052 <vector33>:
.globl vector33
vector33:
  pushl $0
  102052:	6a 00                	push   $0x0
  pushl $33
  102054:	6a 21                	push   $0x21
  jmp __alltraps
  102056:	e9 ba fe ff ff       	jmp    101f15 <__alltraps>

0010205b <vector34>:
.globl vector34
vector34:
  pushl $0
  10205b:	6a 00                	push   $0x0
  pushl $34
  10205d:	6a 22                	push   $0x22
  jmp __alltraps
  10205f:	e9 b1 fe ff ff       	jmp    101f15 <__alltraps>

00102064 <vector35>:
.globl vector35
vector35:
  pushl $0
  102064:	6a 00                	push   $0x0
  pushl $35
  102066:	6a 23                	push   $0x23
  jmp __alltraps
  102068:	e9 a8 fe ff ff       	jmp    101f15 <__alltraps>

0010206d <vector36>:
.globl vector36
vector36:
  pushl $0
  10206d:	6a 00                	push   $0x0
  pushl $36
  10206f:	6a 24                	push   $0x24
  jmp __alltraps
  102071:	e9 9f fe ff ff       	jmp    101f15 <__alltraps>

00102076 <vector37>:
.globl vector37
vector37:
  pushl $0
  102076:	6a 00                	push   $0x0
  pushl $37
  102078:	6a 25                	push   $0x25
  jmp __alltraps
  10207a:	e9 96 fe ff ff       	jmp    101f15 <__alltraps>

0010207f <vector38>:
.globl vector38
vector38:
  pushl $0
  10207f:	6a 00                	push   $0x0
  pushl $38
  102081:	6a 26                	push   $0x26
  jmp __alltraps
  102083:	e9 8d fe ff ff       	jmp    101f15 <__alltraps>

00102088 <vector39>:
.globl vector39
vector39:
  pushl $0
  102088:	6a 00                	push   $0x0
  pushl $39
  10208a:	6a 27                	push   $0x27
  jmp __alltraps
  10208c:	e9 84 fe ff ff       	jmp    101f15 <__alltraps>

00102091 <vector40>:
.globl vector40
vector40:
  pushl $0
  102091:	6a 00                	push   $0x0
  pushl $40
  102093:	6a 28                	push   $0x28
  jmp __alltraps
  102095:	e9 7b fe ff ff       	jmp    101f15 <__alltraps>

0010209a <vector41>:
.globl vector41
vector41:
  pushl $0
  10209a:	6a 00                	push   $0x0
  pushl $41
  10209c:	6a 29                	push   $0x29
  jmp __alltraps
  10209e:	e9 72 fe ff ff       	jmp    101f15 <__alltraps>

001020a3 <vector42>:
.globl vector42
vector42:
  pushl $0
  1020a3:	6a 00                	push   $0x0
  pushl $42
  1020a5:	6a 2a                	push   $0x2a
  jmp __alltraps
  1020a7:	e9 69 fe ff ff       	jmp    101f15 <__alltraps>

001020ac <vector43>:
.globl vector43
vector43:
  pushl $0
  1020ac:	6a 00                	push   $0x0
  pushl $43
  1020ae:	6a 2b                	push   $0x2b
  jmp __alltraps
  1020b0:	e9 60 fe ff ff       	jmp    101f15 <__alltraps>

001020b5 <vector44>:
.globl vector44
vector44:
  pushl $0
  1020b5:	6a 00                	push   $0x0
  pushl $44
  1020b7:	6a 2c                	push   $0x2c
  jmp __alltraps
  1020b9:	e9 57 fe ff ff       	jmp    101f15 <__alltraps>

001020be <vector45>:
.globl vector45
vector45:
  pushl $0
  1020be:	6a 00                	push   $0x0
  pushl $45
  1020c0:	6a 2d                	push   $0x2d
  jmp __alltraps
  1020c2:	e9 4e fe ff ff       	jmp    101f15 <__alltraps>

001020c7 <vector46>:
.globl vector46
vector46:
  pushl $0
  1020c7:	6a 00                	push   $0x0
  pushl $46
  1020c9:	6a 2e                	push   $0x2e
  jmp __alltraps
  1020cb:	e9 45 fe ff ff       	jmp    101f15 <__alltraps>

001020d0 <vector47>:
.globl vector47
vector47:
  pushl $0
  1020d0:	6a 00                	push   $0x0
  pushl $47
  1020d2:	6a 2f                	push   $0x2f
  jmp __alltraps
  1020d4:	e9 3c fe ff ff       	jmp    101f15 <__alltraps>

001020d9 <vector48>:
.globl vector48
vector48:
  pushl $0
  1020d9:	6a 00                	push   $0x0
  pushl $48
  1020db:	6a 30                	push   $0x30
  jmp __alltraps
  1020dd:	e9 33 fe ff ff       	jmp    101f15 <__alltraps>

001020e2 <vector49>:
.globl vector49
vector49:
  pushl $0
  1020e2:	6a 00                	push   $0x0
  pushl $49
  1020e4:	6a 31                	push   $0x31
  jmp __alltraps
  1020e6:	e9 2a fe ff ff       	jmp    101f15 <__alltraps>

001020eb <vector50>:
.globl vector50
vector50:
  pushl $0
  1020eb:	6a 00                	push   $0x0
  pushl $50
  1020ed:	6a 32                	push   $0x32
  jmp __alltraps
  1020ef:	e9 21 fe ff ff       	jmp    101f15 <__alltraps>

001020f4 <vector51>:
.globl vector51
vector51:
  pushl $0
  1020f4:	6a 00                	push   $0x0
  pushl $51
  1020f6:	6a 33                	push   $0x33
  jmp __alltraps
  1020f8:	e9 18 fe ff ff       	jmp    101f15 <__alltraps>

001020fd <vector52>:
.globl vector52
vector52:
  pushl $0
  1020fd:	6a 00                	push   $0x0
  pushl $52
  1020ff:	6a 34                	push   $0x34
  jmp __alltraps
  102101:	e9 0f fe ff ff       	jmp    101f15 <__alltraps>

00102106 <vector53>:
.globl vector53
vector53:
  pushl $0
  102106:	6a 00                	push   $0x0
  pushl $53
  102108:	6a 35                	push   $0x35
  jmp __alltraps
  10210a:	e9 06 fe ff ff       	jmp    101f15 <__alltraps>

0010210f <vector54>:
.globl vector54
vector54:
  pushl $0
  10210f:	6a 00                	push   $0x0
  pushl $54
  102111:	6a 36                	push   $0x36
  jmp __alltraps
  102113:	e9 fd fd ff ff       	jmp    101f15 <__alltraps>

00102118 <vector55>:
.globl vector55
vector55:
  pushl $0
  102118:	6a 00                	push   $0x0
  pushl $55
  10211a:	6a 37                	push   $0x37
  jmp __alltraps
  10211c:	e9 f4 fd ff ff       	jmp    101f15 <__alltraps>

00102121 <vector56>:
.globl vector56
vector56:
  pushl $0
  102121:	6a 00                	push   $0x0
  pushl $56
  102123:	6a 38                	push   $0x38
  jmp __alltraps
  102125:	e9 eb fd ff ff       	jmp    101f15 <__alltraps>

0010212a <vector57>:
.globl vector57
vector57:
  pushl $0
  10212a:	6a 00                	push   $0x0
  pushl $57
  10212c:	6a 39                	push   $0x39
  jmp __alltraps
  10212e:	e9 e2 fd ff ff       	jmp    101f15 <__alltraps>

00102133 <vector58>:
.globl vector58
vector58:
  pushl $0
  102133:	6a 00                	push   $0x0
  pushl $58
  102135:	6a 3a                	push   $0x3a
  jmp __alltraps
  102137:	e9 d9 fd ff ff       	jmp    101f15 <__alltraps>

0010213c <vector59>:
.globl vector59
vector59:
  pushl $0
  10213c:	6a 00                	push   $0x0
  pushl $59
  10213e:	6a 3b                	push   $0x3b
  jmp __alltraps
  102140:	e9 d0 fd ff ff       	jmp    101f15 <__alltraps>

00102145 <vector60>:
.globl vector60
vector60:
  pushl $0
  102145:	6a 00                	push   $0x0
  pushl $60
  102147:	6a 3c                	push   $0x3c
  jmp __alltraps
  102149:	e9 c7 fd ff ff       	jmp    101f15 <__alltraps>

0010214e <vector61>:
.globl vector61
vector61:
  pushl $0
  10214e:	6a 00                	push   $0x0
  pushl $61
  102150:	6a 3d                	push   $0x3d
  jmp __alltraps
  102152:	e9 be fd ff ff       	jmp    101f15 <__alltraps>

00102157 <vector62>:
.globl vector62
vector62:
  pushl $0
  102157:	6a 00                	push   $0x0
  pushl $62
  102159:	6a 3e                	push   $0x3e
  jmp __alltraps
  10215b:	e9 b5 fd ff ff       	jmp    101f15 <__alltraps>

00102160 <vector63>:
.globl vector63
vector63:
  pushl $0
  102160:	6a 00                	push   $0x0
  pushl $63
  102162:	6a 3f                	push   $0x3f
  jmp __alltraps
  102164:	e9 ac fd ff ff       	jmp    101f15 <__alltraps>

00102169 <vector64>:
.globl vector64
vector64:
  pushl $0
  102169:	6a 00                	push   $0x0
  pushl $64
  10216b:	6a 40                	push   $0x40
  jmp __alltraps
  10216d:	e9 a3 fd ff ff       	jmp    101f15 <__alltraps>

00102172 <vector65>:
.globl vector65
vector65:
  pushl $0
  102172:	6a 00                	push   $0x0
  pushl $65
  102174:	6a 41                	push   $0x41
  jmp __alltraps
  102176:	e9 9a fd ff ff       	jmp    101f15 <__alltraps>

0010217b <vector66>:
.globl vector66
vector66:
  pushl $0
  10217b:	6a 00                	push   $0x0
  pushl $66
  10217d:	6a 42                	push   $0x42
  jmp __alltraps
  10217f:	e9 91 fd ff ff       	jmp    101f15 <__alltraps>

00102184 <vector67>:
.globl vector67
vector67:
  pushl $0
  102184:	6a 00                	push   $0x0
  pushl $67
  102186:	6a 43                	push   $0x43
  jmp __alltraps
  102188:	e9 88 fd ff ff       	jmp    101f15 <__alltraps>

0010218d <vector68>:
.globl vector68
vector68:
  pushl $0
  10218d:	6a 00                	push   $0x0
  pushl $68
  10218f:	6a 44                	push   $0x44
  jmp __alltraps
  102191:	e9 7f fd ff ff       	jmp    101f15 <__alltraps>

00102196 <vector69>:
.globl vector69
vector69:
  pushl $0
  102196:	6a 00                	push   $0x0
  pushl $69
  102198:	6a 45                	push   $0x45
  jmp __alltraps
  10219a:	e9 76 fd ff ff       	jmp    101f15 <__alltraps>

0010219f <vector70>:
.globl vector70
vector70:
  pushl $0
  10219f:	6a 00                	push   $0x0
  pushl $70
  1021a1:	6a 46                	push   $0x46
  jmp __alltraps
  1021a3:	e9 6d fd ff ff       	jmp    101f15 <__alltraps>

001021a8 <vector71>:
.globl vector71
vector71:
  pushl $0
  1021a8:	6a 00                	push   $0x0
  pushl $71
  1021aa:	6a 47                	push   $0x47
  jmp __alltraps
  1021ac:	e9 64 fd ff ff       	jmp    101f15 <__alltraps>

001021b1 <vector72>:
.globl vector72
vector72:
  pushl $0
  1021b1:	6a 00                	push   $0x0
  pushl $72
  1021b3:	6a 48                	push   $0x48
  jmp __alltraps
  1021b5:	e9 5b fd ff ff       	jmp    101f15 <__alltraps>

001021ba <vector73>:
.globl vector73
vector73:
  pushl $0
  1021ba:	6a 00                	push   $0x0
  pushl $73
  1021bc:	6a 49                	push   $0x49
  jmp __alltraps
  1021be:	e9 52 fd ff ff       	jmp    101f15 <__alltraps>

001021c3 <vector74>:
.globl vector74
vector74:
  pushl $0
  1021c3:	6a 00                	push   $0x0
  pushl $74
  1021c5:	6a 4a                	push   $0x4a
  jmp __alltraps
  1021c7:	e9 49 fd ff ff       	jmp    101f15 <__alltraps>

001021cc <vector75>:
.globl vector75
vector75:
  pushl $0
  1021cc:	6a 00                	push   $0x0
  pushl $75
  1021ce:	6a 4b                	push   $0x4b
  jmp __alltraps
  1021d0:	e9 40 fd ff ff       	jmp    101f15 <__alltraps>

001021d5 <vector76>:
.globl vector76
vector76:
  pushl $0
  1021d5:	6a 00                	push   $0x0
  pushl $76
  1021d7:	6a 4c                	push   $0x4c
  jmp __alltraps
  1021d9:	e9 37 fd ff ff       	jmp    101f15 <__alltraps>

001021de <vector77>:
.globl vector77
vector77:
  pushl $0
  1021de:	6a 00                	push   $0x0
  pushl $77
  1021e0:	6a 4d                	push   $0x4d
  jmp __alltraps
  1021e2:	e9 2e fd ff ff       	jmp    101f15 <__alltraps>

001021e7 <vector78>:
.globl vector78
vector78:
  pushl $0
  1021e7:	6a 00                	push   $0x0
  pushl $78
  1021e9:	6a 4e                	push   $0x4e
  jmp __alltraps
  1021eb:	e9 25 fd ff ff       	jmp    101f15 <__alltraps>

001021f0 <vector79>:
.globl vector79
vector79:
  pushl $0
  1021f0:	6a 00                	push   $0x0
  pushl $79
  1021f2:	6a 4f                	push   $0x4f
  jmp __alltraps
  1021f4:	e9 1c fd ff ff       	jmp    101f15 <__alltraps>

001021f9 <vector80>:
.globl vector80
vector80:
  pushl $0
  1021f9:	6a 00                	push   $0x0
  pushl $80
  1021fb:	6a 50                	push   $0x50
  jmp __alltraps
  1021fd:	e9 13 fd ff ff       	jmp    101f15 <__alltraps>

00102202 <vector81>:
.globl vector81
vector81:
  pushl $0
  102202:	6a 00                	push   $0x0
  pushl $81
  102204:	6a 51                	push   $0x51
  jmp __alltraps
  102206:	e9 0a fd ff ff       	jmp    101f15 <__alltraps>

0010220b <vector82>:
.globl vector82
vector82:
  pushl $0
  10220b:	6a 00                	push   $0x0
  pushl $82
  10220d:	6a 52                	push   $0x52
  jmp __alltraps
  10220f:	e9 01 fd ff ff       	jmp    101f15 <__alltraps>

00102214 <vector83>:
.globl vector83
vector83:
  pushl $0
  102214:	6a 00                	push   $0x0
  pushl $83
  102216:	6a 53                	push   $0x53
  jmp __alltraps
  102218:	e9 f8 fc ff ff       	jmp    101f15 <__alltraps>

0010221d <vector84>:
.globl vector84
vector84:
  pushl $0
  10221d:	6a 00                	push   $0x0
  pushl $84
  10221f:	6a 54                	push   $0x54
  jmp __alltraps
  102221:	e9 ef fc ff ff       	jmp    101f15 <__alltraps>

00102226 <vector85>:
.globl vector85
vector85:
  pushl $0
  102226:	6a 00                	push   $0x0
  pushl $85
  102228:	6a 55                	push   $0x55
  jmp __alltraps
  10222a:	e9 e6 fc ff ff       	jmp    101f15 <__alltraps>

0010222f <vector86>:
.globl vector86
vector86:
  pushl $0
  10222f:	6a 00                	push   $0x0
  pushl $86
  102231:	6a 56                	push   $0x56
  jmp __alltraps
  102233:	e9 dd fc ff ff       	jmp    101f15 <__alltraps>

00102238 <vector87>:
.globl vector87
vector87:
  pushl $0
  102238:	6a 00                	push   $0x0
  pushl $87
  10223a:	6a 57                	push   $0x57
  jmp __alltraps
  10223c:	e9 d4 fc ff ff       	jmp    101f15 <__alltraps>

00102241 <vector88>:
.globl vector88
vector88:
  pushl $0
  102241:	6a 00                	push   $0x0
  pushl $88
  102243:	6a 58                	push   $0x58
  jmp __alltraps
  102245:	e9 cb fc ff ff       	jmp    101f15 <__alltraps>

0010224a <vector89>:
.globl vector89
vector89:
  pushl $0
  10224a:	6a 00                	push   $0x0
  pushl $89
  10224c:	6a 59                	push   $0x59
  jmp __alltraps
  10224e:	e9 c2 fc ff ff       	jmp    101f15 <__alltraps>

00102253 <vector90>:
.globl vector90
vector90:
  pushl $0
  102253:	6a 00                	push   $0x0
  pushl $90
  102255:	6a 5a                	push   $0x5a
  jmp __alltraps
  102257:	e9 b9 fc ff ff       	jmp    101f15 <__alltraps>

0010225c <vector91>:
.globl vector91
vector91:
  pushl $0
  10225c:	6a 00                	push   $0x0
  pushl $91
  10225e:	6a 5b                	push   $0x5b
  jmp __alltraps
  102260:	e9 b0 fc ff ff       	jmp    101f15 <__alltraps>

00102265 <vector92>:
.globl vector92
vector92:
  pushl $0
  102265:	6a 00                	push   $0x0
  pushl $92
  102267:	6a 5c                	push   $0x5c
  jmp __alltraps
  102269:	e9 a7 fc ff ff       	jmp    101f15 <__alltraps>

0010226e <vector93>:
.globl vector93
vector93:
  pushl $0
  10226e:	6a 00                	push   $0x0
  pushl $93
  102270:	6a 5d                	push   $0x5d
  jmp __alltraps
  102272:	e9 9e fc ff ff       	jmp    101f15 <__alltraps>

00102277 <vector94>:
.globl vector94
vector94:
  pushl $0
  102277:	6a 00                	push   $0x0
  pushl $94
  102279:	6a 5e                	push   $0x5e
  jmp __alltraps
  10227b:	e9 95 fc ff ff       	jmp    101f15 <__alltraps>

00102280 <vector95>:
.globl vector95
vector95:
  pushl $0
  102280:	6a 00                	push   $0x0
  pushl $95
  102282:	6a 5f                	push   $0x5f
  jmp __alltraps
  102284:	e9 8c fc ff ff       	jmp    101f15 <__alltraps>

00102289 <vector96>:
.globl vector96
vector96:
  pushl $0
  102289:	6a 00                	push   $0x0
  pushl $96
  10228b:	6a 60                	push   $0x60
  jmp __alltraps
  10228d:	e9 83 fc ff ff       	jmp    101f15 <__alltraps>

00102292 <vector97>:
.globl vector97
vector97:
  pushl $0
  102292:	6a 00                	push   $0x0
  pushl $97
  102294:	6a 61                	push   $0x61
  jmp __alltraps
  102296:	e9 7a fc ff ff       	jmp    101f15 <__alltraps>

0010229b <vector98>:
.globl vector98
vector98:
  pushl $0
  10229b:	6a 00                	push   $0x0
  pushl $98
  10229d:	6a 62                	push   $0x62
  jmp __alltraps
  10229f:	e9 71 fc ff ff       	jmp    101f15 <__alltraps>

001022a4 <vector99>:
.globl vector99
vector99:
  pushl $0
  1022a4:	6a 00                	push   $0x0
  pushl $99
  1022a6:	6a 63                	push   $0x63
  jmp __alltraps
  1022a8:	e9 68 fc ff ff       	jmp    101f15 <__alltraps>

001022ad <vector100>:
.globl vector100
vector100:
  pushl $0
  1022ad:	6a 00                	push   $0x0
  pushl $100
  1022af:	6a 64                	push   $0x64
  jmp __alltraps
  1022b1:	e9 5f fc ff ff       	jmp    101f15 <__alltraps>

001022b6 <vector101>:
.globl vector101
vector101:
  pushl $0
  1022b6:	6a 00                	push   $0x0
  pushl $101
  1022b8:	6a 65                	push   $0x65
  jmp __alltraps
  1022ba:	e9 56 fc ff ff       	jmp    101f15 <__alltraps>

001022bf <vector102>:
.globl vector102
vector102:
  pushl $0
  1022bf:	6a 00                	push   $0x0
  pushl $102
  1022c1:	6a 66                	push   $0x66
  jmp __alltraps
  1022c3:	e9 4d fc ff ff       	jmp    101f15 <__alltraps>

001022c8 <vector103>:
.globl vector103
vector103:
  pushl $0
  1022c8:	6a 00                	push   $0x0
  pushl $103
  1022ca:	6a 67                	push   $0x67
  jmp __alltraps
  1022cc:	e9 44 fc ff ff       	jmp    101f15 <__alltraps>

001022d1 <vector104>:
.globl vector104
vector104:
  pushl $0
  1022d1:	6a 00                	push   $0x0
  pushl $104
  1022d3:	6a 68                	push   $0x68
  jmp __alltraps
  1022d5:	e9 3b fc ff ff       	jmp    101f15 <__alltraps>

001022da <vector105>:
.globl vector105
vector105:
  pushl $0
  1022da:	6a 00                	push   $0x0
  pushl $105
  1022dc:	6a 69                	push   $0x69
  jmp __alltraps
  1022de:	e9 32 fc ff ff       	jmp    101f15 <__alltraps>

001022e3 <vector106>:
.globl vector106
vector106:
  pushl $0
  1022e3:	6a 00                	push   $0x0
  pushl $106
  1022e5:	6a 6a                	push   $0x6a
  jmp __alltraps
  1022e7:	e9 29 fc ff ff       	jmp    101f15 <__alltraps>

001022ec <vector107>:
.globl vector107
vector107:
  pushl $0
  1022ec:	6a 00                	push   $0x0
  pushl $107
  1022ee:	6a 6b                	push   $0x6b
  jmp __alltraps
  1022f0:	e9 20 fc ff ff       	jmp    101f15 <__alltraps>

001022f5 <vector108>:
.globl vector108
vector108:
  pushl $0
  1022f5:	6a 00                	push   $0x0
  pushl $108
  1022f7:	6a 6c                	push   $0x6c
  jmp __alltraps
  1022f9:	e9 17 fc ff ff       	jmp    101f15 <__alltraps>

001022fe <vector109>:
.globl vector109
vector109:
  pushl $0
  1022fe:	6a 00                	push   $0x0
  pushl $109
  102300:	6a 6d                	push   $0x6d
  jmp __alltraps
  102302:	e9 0e fc ff ff       	jmp    101f15 <__alltraps>

00102307 <vector110>:
.globl vector110
vector110:
  pushl $0
  102307:	6a 00                	push   $0x0
  pushl $110
  102309:	6a 6e                	push   $0x6e
  jmp __alltraps
  10230b:	e9 05 fc ff ff       	jmp    101f15 <__alltraps>

00102310 <vector111>:
.globl vector111
vector111:
  pushl $0
  102310:	6a 00                	push   $0x0
  pushl $111
  102312:	6a 6f                	push   $0x6f
  jmp __alltraps
  102314:	e9 fc fb ff ff       	jmp    101f15 <__alltraps>

00102319 <vector112>:
.globl vector112
vector112:
  pushl $0
  102319:	6a 00                	push   $0x0
  pushl $112
  10231b:	6a 70                	push   $0x70
  jmp __alltraps
  10231d:	e9 f3 fb ff ff       	jmp    101f15 <__alltraps>

00102322 <vector113>:
.globl vector113
vector113:
  pushl $0
  102322:	6a 00                	push   $0x0
  pushl $113
  102324:	6a 71                	push   $0x71
  jmp __alltraps
  102326:	e9 ea fb ff ff       	jmp    101f15 <__alltraps>

0010232b <vector114>:
.globl vector114
vector114:
  pushl $0
  10232b:	6a 00                	push   $0x0
  pushl $114
  10232d:	6a 72                	push   $0x72
  jmp __alltraps
  10232f:	e9 e1 fb ff ff       	jmp    101f15 <__alltraps>

00102334 <vector115>:
.globl vector115
vector115:
  pushl $0
  102334:	6a 00                	push   $0x0
  pushl $115
  102336:	6a 73                	push   $0x73
  jmp __alltraps
  102338:	e9 d8 fb ff ff       	jmp    101f15 <__alltraps>

0010233d <vector116>:
.globl vector116
vector116:
  pushl $0
  10233d:	6a 00                	push   $0x0
  pushl $116
  10233f:	6a 74                	push   $0x74
  jmp __alltraps
  102341:	e9 cf fb ff ff       	jmp    101f15 <__alltraps>

00102346 <vector117>:
.globl vector117
vector117:
  pushl $0
  102346:	6a 00                	push   $0x0
  pushl $117
  102348:	6a 75                	push   $0x75
  jmp __alltraps
  10234a:	e9 c6 fb ff ff       	jmp    101f15 <__alltraps>

0010234f <vector118>:
.globl vector118
vector118:
  pushl $0
  10234f:	6a 00                	push   $0x0
  pushl $118
  102351:	6a 76                	push   $0x76
  jmp __alltraps
  102353:	e9 bd fb ff ff       	jmp    101f15 <__alltraps>

00102358 <vector119>:
.globl vector119
vector119:
  pushl $0
  102358:	6a 00                	push   $0x0
  pushl $119
  10235a:	6a 77                	push   $0x77
  jmp __alltraps
  10235c:	e9 b4 fb ff ff       	jmp    101f15 <__alltraps>

00102361 <vector120>:
.globl vector120
vector120:
  pushl $0
  102361:	6a 00                	push   $0x0
  pushl $120
  102363:	6a 78                	push   $0x78
  jmp __alltraps
  102365:	e9 ab fb ff ff       	jmp    101f15 <__alltraps>

0010236a <vector121>:
.globl vector121
vector121:
  pushl $0
  10236a:	6a 00                	push   $0x0
  pushl $121
  10236c:	6a 79                	push   $0x79
  jmp __alltraps
  10236e:	e9 a2 fb ff ff       	jmp    101f15 <__alltraps>

00102373 <vector122>:
.globl vector122
vector122:
  pushl $0
  102373:	6a 00                	push   $0x0
  pushl $122
  102375:	6a 7a                	push   $0x7a
  jmp __alltraps
  102377:	e9 99 fb ff ff       	jmp    101f15 <__alltraps>

0010237c <vector123>:
.globl vector123
vector123:
  pushl $0
  10237c:	6a 00                	push   $0x0
  pushl $123
  10237e:	6a 7b                	push   $0x7b
  jmp __alltraps
  102380:	e9 90 fb ff ff       	jmp    101f15 <__alltraps>

00102385 <vector124>:
.globl vector124
vector124:
  pushl $0
  102385:	6a 00                	push   $0x0
  pushl $124
  102387:	6a 7c                	push   $0x7c
  jmp __alltraps
  102389:	e9 87 fb ff ff       	jmp    101f15 <__alltraps>

0010238e <vector125>:
.globl vector125
vector125:
  pushl $0
  10238e:	6a 00                	push   $0x0
  pushl $125
  102390:	6a 7d                	push   $0x7d
  jmp __alltraps
  102392:	e9 7e fb ff ff       	jmp    101f15 <__alltraps>

00102397 <vector126>:
.globl vector126
vector126:
  pushl $0
  102397:	6a 00                	push   $0x0
  pushl $126
  102399:	6a 7e                	push   $0x7e
  jmp __alltraps
  10239b:	e9 75 fb ff ff       	jmp    101f15 <__alltraps>

001023a0 <vector127>:
.globl vector127
vector127:
  pushl $0
  1023a0:	6a 00                	push   $0x0
  pushl $127
  1023a2:	6a 7f                	push   $0x7f
  jmp __alltraps
  1023a4:	e9 6c fb ff ff       	jmp    101f15 <__alltraps>

001023a9 <vector128>:
.globl vector128
vector128:
  pushl $0
  1023a9:	6a 00                	push   $0x0
  pushl $128
  1023ab:	68 80 00 00 00       	push   $0x80
  jmp __alltraps
  1023b0:	e9 60 fb ff ff       	jmp    101f15 <__alltraps>

001023b5 <vector129>:
.globl vector129
vector129:
  pushl $0
  1023b5:	6a 00                	push   $0x0
  pushl $129
  1023b7:	68 81 00 00 00       	push   $0x81
  jmp __alltraps
  1023bc:	e9 54 fb ff ff       	jmp    101f15 <__alltraps>

001023c1 <vector130>:
.globl vector130
vector130:
  pushl $0
  1023c1:	6a 00                	push   $0x0
  pushl $130
  1023c3:	68 82 00 00 00       	push   $0x82
  jmp __alltraps
  1023c8:	e9 48 fb ff ff       	jmp    101f15 <__alltraps>

001023cd <vector131>:
.globl vector131
vector131:
  pushl $0
  1023cd:	6a 00                	push   $0x0
  pushl $131
  1023cf:	68 83 00 00 00       	push   $0x83
  jmp __alltraps
  1023d4:	e9 3c fb ff ff       	jmp    101f15 <__alltraps>

001023d9 <vector132>:
.globl vector132
vector132:
  pushl $0
  1023d9:	6a 00                	push   $0x0
  pushl $132
  1023db:	68 84 00 00 00       	push   $0x84
  jmp __alltraps
  1023e0:	e9 30 fb ff ff       	jmp    101f15 <__alltraps>

001023e5 <vector133>:
.globl vector133
vector133:
  pushl $0
  1023e5:	6a 00                	push   $0x0
  pushl $133
  1023e7:	68 85 00 00 00       	push   $0x85
  jmp __alltraps
  1023ec:	e9 24 fb ff ff       	jmp    101f15 <__alltraps>

001023f1 <vector134>:
.globl vector134
vector134:
  pushl $0
  1023f1:	6a 00                	push   $0x0
  pushl $134
  1023f3:	68 86 00 00 00       	push   $0x86
  jmp __alltraps
  1023f8:	e9 18 fb ff ff       	jmp    101f15 <__alltraps>

001023fd <vector135>:
.globl vector135
vector135:
  pushl $0
  1023fd:	6a 00                	push   $0x0
  pushl $135
  1023ff:	68 87 00 00 00       	push   $0x87
  jmp __alltraps
  102404:	e9 0c fb ff ff       	jmp    101f15 <__alltraps>

00102409 <vector136>:
.globl vector136
vector136:
  pushl $0
  102409:	6a 00                	push   $0x0
  pushl $136
  10240b:	68 88 00 00 00       	push   $0x88
  jmp __alltraps
  102410:	e9 00 fb ff ff       	jmp    101f15 <__alltraps>

00102415 <vector137>:
.globl vector137
vector137:
  pushl $0
  102415:	6a 00                	push   $0x0
  pushl $137
  102417:	68 89 00 00 00       	push   $0x89
  jmp __alltraps
  10241c:	e9 f4 fa ff ff       	jmp    101f15 <__alltraps>

00102421 <vector138>:
.globl vector138
vector138:
  pushl $0
  102421:	6a 00                	push   $0x0
  pushl $138
  102423:	68 8a 00 00 00       	push   $0x8a
  jmp __alltraps
  102428:	e9 e8 fa ff ff       	jmp    101f15 <__alltraps>

0010242d <vector139>:
.globl vector139
vector139:
  pushl $0
  10242d:	6a 00                	push   $0x0
  pushl $139
  10242f:	68 8b 00 00 00       	push   $0x8b
  jmp __alltraps
  102434:	e9 dc fa ff ff       	jmp    101f15 <__alltraps>

00102439 <vector140>:
.globl vector140
vector140:
  pushl $0
  102439:	6a 00                	push   $0x0
  pushl $140
  10243b:	68 8c 00 00 00       	push   $0x8c
  jmp __alltraps
  102440:	e9 d0 fa ff ff       	jmp    101f15 <__alltraps>

00102445 <vector141>:
.globl vector141
vector141:
  pushl $0
  102445:	6a 00                	push   $0x0
  pushl $141
  102447:	68 8d 00 00 00       	push   $0x8d
  jmp __alltraps
  10244c:	e9 c4 fa ff ff       	jmp    101f15 <__alltraps>

00102451 <vector142>:
.globl vector142
vector142:
  pushl $0
  102451:	6a 00                	push   $0x0
  pushl $142
  102453:	68 8e 00 00 00       	push   $0x8e
  jmp __alltraps
  102458:	e9 b8 fa ff ff       	jmp    101f15 <__alltraps>

0010245d <vector143>:
.globl vector143
vector143:
  pushl $0
  10245d:	6a 00                	push   $0x0
  pushl $143
  10245f:	68 8f 00 00 00       	push   $0x8f
  jmp __alltraps
  102464:	e9 ac fa ff ff       	jmp    101f15 <__alltraps>

00102469 <vector144>:
.globl vector144
vector144:
  pushl $0
  102469:	6a 00                	push   $0x0
  pushl $144
  10246b:	68 90 00 00 00       	push   $0x90
  jmp __alltraps
  102470:	e9 a0 fa ff ff       	jmp    101f15 <__alltraps>

00102475 <vector145>:
.globl vector145
vector145:
  pushl $0
  102475:	6a 00                	push   $0x0
  pushl $145
  102477:	68 91 00 00 00       	push   $0x91
  jmp __alltraps
  10247c:	e9 94 fa ff ff       	jmp    101f15 <__alltraps>

00102481 <vector146>:
.globl vector146
vector146:
  pushl $0
  102481:	6a 00                	push   $0x0
  pushl $146
  102483:	68 92 00 00 00       	push   $0x92
  jmp __alltraps
  102488:	e9 88 fa ff ff       	jmp    101f15 <__alltraps>

0010248d <vector147>:
.globl vector147
vector147:
  pushl $0
  10248d:	6a 00                	push   $0x0
  pushl $147
  10248f:	68 93 00 00 00       	push   $0x93
  jmp __alltraps
  102494:	e9 7c fa ff ff       	jmp    101f15 <__alltraps>

00102499 <vector148>:
.globl vector148
vector148:
  pushl $0
  102499:	6a 00                	push   $0x0
  pushl $148
  10249b:	68 94 00 00 00       	push   $0x94
  jmp __alltraps
  1024a0:	e9 70 fa ff ff       	jmp    101f15 <__alltraps>

001024a5 <vector149>:
.globl vector149
vector149:
  pushl $0
  1024a5:	6a 00                	push   $0x0
  pushl $149
  1024a7:	68 95 00 00 00       	push   $0x95
  jmp __alltraps
  1024ac:	e9 64 fa ff ff       	jmp    101f15 <__alltraps>

001024b1 <vector150>:
.globl vector150
vector150:
  pushl $0
  1024b1:	6a 00                	push   $0x0
  pushl $150
  1024b3:	68 96 00 00 00       	push   $0x96
  jmp __alltraps
  1024b8:	e9 58 fa ff ff       	jmp    101f15 <__alltraps>

001024bd <vector151>:
.globl vector151
vector151:
  pushl $0
  1024bd:	6a 00                	push   $0x0
  pushl $151
  1024bf:	68 97 00 00 00       	push   $0x97
  jmp __alltraps
  1024c4:	e9 4c fa ff ff       	jmp    101f15 <__alltraps>

001024c9 <vector152>:
.globl vector152
vector152:
  pushl $0
  1024c9:	6a 00                	push   $0x0
  pushl $152
  1024cb:	68 98 00 00 00       	push   $0x98
  jmp __alltraps
  1024d0:	e9 40 fa ff ff       	jmp    101f15 <__alltraps>

001024d5 <vector153>:
.globl vector153
vector153:
  pushl $0
  1024d5:	6a 00                	push   $0x0
  pushl $153
  1024d7:	68 99 00 00 00       	push   $0x99
  jmp __alltraps
  1024dc:	e9 34 fa ff ff       	jmp    101f15 <__alltraps>

001024e1 <vector154>:
.globl vector154
vector154:
  pushl $0
  1024e1:	6a 00                	push   $0x0
  pushl $154
  1024e3:	68 9a 00 00 00       	push   $0x9a
  jmp __alltraps
  1024e8:	e9 28 fa ff ff       	jmp    101f15 <__alltraps>

001024ed <vector155>:
.globl vector155
vector155:
  pushl $0
  1024ed:	6a 00                	push   $0x0
  pushl $155
  1024ef:	68 9b 00 00 00       	push   $0x9b
  jmp __alltraps
  1024f4:	e9 1c fa ff ff       	jmp    101f15 <__alltraps>

001024f9 <vector156>:
.globl vector156
vector156:
  pushl $0
  1024f9:	6a 00                	push   $0x0
  pushl $156
  1024fb:	68 9c 00 00 00       	push   $0x9c
  jmp __alltraps
  102500:	e9 10 fa ff ff       	jmp    101f15 <__alltraps>

00102505 <vector157>:
.globl vector157
vector157:
  pushl $0
  102505:	6a 00                	push   $0x0
  pushl $157
  102507:	68 9d 00 00 00       	push   $0x9d
  jmp __alltraps
  10250c:	e9 04 fa ff ff       	jmp    101f15 <__alltraps>

00102511 <vector158>:
.globl vector158
vector158:
  pushl $0
  102511:	6a 00                	push   $0x0
  pushl $158
  102513:	68 9e 00 00 00       	push   $0x9e
  jmp __alltraps
  102518:	e9 f8 f9 ff ff       	jmp    101f15 <__alltraps>

0010251d <vector159>:
.globl vector159
vector159:
  pushl $0
  10251d:	6a 00                	push   $0x0
  pushl $159
  10251f:	68 9f 00 00 00       	push   $0x9f
  jmp __alltraps
  102524:	e9 ec f9 ff ff       	jmp    101f15 <__alltraps>

00102529 <vector160>:
.globl vector160
vector160:
  pushl $0
  102529:	6a 00                	push   $0x0
  pushl $160
  10252b:	68 a0 00 00 00       	push   $0xa0
  jmp __alltraps
  102530:	e9 e0 f9 ff ff       	jmp    101f15 <__alltraps>

00102535 <vector161>:
.globl vector161
vector161:
  pushl $0
  102535:	6a 00                	push   $0x0
  pushl $161
  102537:	68 a1 00 00 00       	push   $0xa1
  jmp __alltraps
  10253c:	e9 d4 f9 ff ff       	jmp    101f15 <__alltraps>

00102541 <vector162>:
.globl vector162
vector162:
  pushl $0
  102541:	6a 00                	push   $0x0
  pushl $162
  102543:	68 a2 00 00 00       	push   $0xa2
  jmp __alltraps
  102548:	e9 c8 f9 ff ff       	jmp    101f15 <__alltraps>

0010254d <vector163>:
.globl vector163
vector163:
  pushl $0
  10254d:	6a 00                	push   $0x0
  pushl $163
  10254f:	68 a3 00 00 00       	push   $0xa3
  jmp __alltraps
  102554:	e9 bc f9 ff ff       	jmp    101f15 <__alltraps>

00102559 <vector164>:
.globl vector164
vector164:
  pushl $0
  102559:	6a 00                	push   $0x0
  pushl $164
  10255b:	68 a4 00 00 00       	push   $0xa4
  jmp __alltraps
  102560:	e9 b0 f9 ff ff       	jmp    101f15 <__alltraps>

00102565 <vector165>:
.globl vector165
vector165:
  pushl $0
  102565:	6a 00                	push   $0x0
  pushl $165
  102567:	68 a5 00 00 00       	push   $0xa5
  jmp __alltraps
  10256c:	e9 a4 f9 ff ff       	jmp    101f15 <__alltraps>

00102571 <vector166>:
.globl vector166
vector166:
  pushl $0
  102571:	6a 00                	push   $0x0
  pushl $166
  102573:	68 a6 00 00 00       	push   $0xa6
  jmp __alltraps
  102578:	e9 98 f9 ff ff       	jmp    101f15 <__alltraps>

0010257d <vector167>:
.globl vector167
vector167:
  pushl $0
  10257d:	6a 00                	push   $0x0
  pushl $167
  10257f:	68 a7 00 00 00       	push   $0xa7
  jmp __alltraps
  102584:	e9 8c f9 ff ff       	jmp    101f15 <__alltraps>

00102589 <vector168>:
.globl vector168
vector168:
  pushl $0
  102589:	6a 00                	push   $0x0
  pushl $168
  10258b:	68 a8 00 00 00       	push   $0xa8
  jmp __alltraps
  102590:	e9 80 f9 ff ff       	jmp    101f15 <__alltraps>

00102595 <vector169>:
.globl vector169
vector169:
  pushl $0
  102595:	6a 00                	push   $0x0
  pushl $169
  102597:	68 a9 00 00 00       	push   $0xa9
  jmp __alltraps
  10259c:	e9 74 f9 ff ff       	jmp    101f15 <__alltraps>

001025a1 <vector170>:
.globl vector170
vector170:
  pushl $0
  1025a1:	6a 00                	push   $0x0
  pushl $170
  1025a3:	68 aa 00 00 00       	push   $0xaa
  jmp __alltraps
  1025a8:	e9 68 f9 ff ff       	jmp    101f15 <__alltraps>

001025ad <vector171>:
.globl vector171
vector171:
  pushl $0
  1025ad:	6a 00                	push   $0x0
  pushl $171
  1025af:	68 ab 00 00 00       	push   $0xab
  jmp __alltraps
  1025b4:	e9 5c f9 ff ff       	jmp    101f15 <__alltraps>

001025b9 <vector172>:
.globl vector172
vector172:
  pushl $0
  1025b9:	6a 00                	push   $0x0
  pushl $172
  1025bb:	68 ac 00 00 00       	push   $0xac
  jmp __alltraps
  1025c0:	e9 50 f9 ff ff       	jmp    101f15 <__alltraps>

001025c5 <vector173>:
.globl vector173
vector173:
  pushl $0
  1025c5:	6a 00                	push   $0x0
  pushl $173
  1025c7:	68 ad 00 00 00       	push   $0xad
  jmp __alltraps
  1025cc:	e9 44 f9 ff ff       	jmp    101f15 <__alltraps>

001025d1 <vector174>:
.globl vector174
vector174:
  pushl $0
  1025d1:	6a 00                	push   $0x0
  pushl $174
  1025d3:	68 ae 00 00 00       	push   $0xae
  jmp __alltraps
  1025d8:	e9 38 f9 ff ff       	jmp    101f15 <__alltraps>

001025dd <vector175>:
.globl vector175
vector175:
  pushl $0
  1025dd:	6a 00                	push   $0x0
  pushl $175
  1025df:	68 af 00 00 00       	push   $0xaf
  jmp __alltraps
  1025e4:	e9 2c f9 ff ff       	jmp    101f15 <__alltraps>

001025e9 <vector176>:
.globl vector176
vector176:
  pushl $0
  1025e9:	6a 00                	push   $0x0
  pushl $176
  1025eb:	68 b0 00 00 00       	push   $0xb0
  jmp __alltraps
  1025f0:	e9 20 f9 ff ff       	jmp    101f15 <__alltraps>

001025f5 <vector177>:
.globl vector177
vector177:
  pushl $0
  1025f5:	6a 00                	push   $0x0
  pushl $177
  1025f7:	68 b1 00 00 00       	push   $0xb1
  jmp __alltraps
  1025fc:	e9 14 f9 ff ff       	jmp    101f15 <__alltraps>

00102601 <vector178>:
.globl vector178
vector178:
  pushl $0
  102601:	6a 00                	push   $0x0
  pushl $178
  102603:	68 b2 00 00 00       	push   $0xb2
  jmp __alltraps
  102608:	e9 08 f9 ff ff       	jmp    101f15 <__alltraps>

0010260d <vector179>:
.globl vector179
vector179:
  pushl $0
  10260d:	6a 00                	push   $0x0
  pushl $179
  10260f:	68 b3 00 00 00       	push   $0xb3
  jmp __alltraps
  102614:	e9 fc f8 ff ff       	jmp    101f15 <__alltraps>

00102619 <vector180>:
.globl vector180
vector180:
  pushl $0
  102619:	6a 00                	push   $0x0
  pushl $180
  10261b:	68 b4 00 00 00       	push   $0xb4
  jmp __alltraps
  102620:	e9 f0 f8 ff ff       	jmp    101f15 <__alltraps>

00102625 <vector181>:
.globl vector181
vector181:
  pushl $0
  102625:	6a 00                	push   $0x0
  pushl $181
  102627:	68 b5 00 00 00       	push   $0xb5
  jmp __alltraps
  10262c:	e9 e4 f8 ff ff       	jmp    101f15 <__alltraps>

00102631 <vector182>:
.globl vector182
vector182:
  pushl $0
  102631:	6a 00                	push   $0x0
  pushl $182
  102633:	68 b6 00 00 00       	push   $0xb6
  jmp __alltraps
  102638:	e9 d8 f8 ff ff       	jmp    101f15 <__alltraps>

0010263d <vector183>:
.globl vector183
vector183:
  pushl $0
  10263d:	6a 00                	push   $0x0
  pushl $183
  10263f:	68 b7 00 00 00       	push   $0xb7
  jmp __alltraps
  102644:	e9 cc f8 ff ff       	jmp    101f15 <__alltraps>

00102649 <vector184>:
.globl vector184
vector184:
  pushl $0
  102649:	6a 00                	push   $0x0
  pushl $184
  10264b:	68 b8 00 00 00       	push   $0xb8
  jmp __alltraps
  102650:	e9 c0 f8 ff ff       	jmp    101f15 <__alltraps>

00102655 <vector185>:
.globl vector185
vector185:
  pushl $0
  102655:	6a 00                	push   $0x0
  pushl $185
  102657:	68 b9 00 00 00       	push   $0xb9
  jmp __alltraps
  10265c:	e9 b4 f8 ff ff       	jmp    101f15 <__alltraps>

00102661 <vector186>:
.globl vector186
vector186:
  pushl $0
  102661:	6a 00                	push   $0x0
  pushl $186
  102663:	68 ba 00 00 00       	push   $0xba
  jmp __alltraps
  102668:	e9 a8 f8 ff ff       	jmp    101f15 <__alltraps>

0010266d <vector187>:
.globl vector187
vector187:
  pushl $0
  10266d:	6a 00                	push   $0x0
  pushl $187
  10266f:	68 bb 00 00 00       	push   $0xbb
  jmp __alltraps
  102674:	e9 9c f8 ff ff       	jmp    101f15 <__alltraps>

00102679 <vector188>:
.globl vector188
vector188:
  pushl $0
  102679:	6a 00                	push   $0x0
  pushl $188
  10267b:	68 bc 00 00 00       	push   $0xbc
  jmp __alltraps
  102680:	e9 90 f8 ff ff       	jmp    101f15 <__alltraps>

00102685 <vector189>:
.globl vector189
vector189:
  pushl $0
  102685:	6a 00                	push   $0x0
  pushl $189
  102687:	68 bd 00 00 00       	push   $0xbd
  jmp __alltraps
  10268c:	e9 84 f8 ff ff       	jmp    101f15 <__alltraps>

00102691 <vector190>:
.globl vector190
vector190:
  pushl $0
  102691:	6a 00                	push   $0x0
  pushl $190
  102693:	68 be 00 00 00       	push   $0xbe
  jmp __alltraps
  102698:	e9 78 f8 ff ff       	jmp    101f15 <__alltraps>

0010269d <vector191>:
.globl vector191
vector191:
  pushl $0
  10269d:	6a 00                	push   $0x0
  pushl $191
  10269f:	68 bf 00 00 00       	push   $0xbf
  jmp __alltraps
  1026a4:	e9 6c f8 ff ff       	jmp    101f15 <__alltraps>

001026a9 <vector192>:
.globl vector192
vector192:
  pushl $0
  1026a9:	6a 00                	push   $0x0
  pushl $192
  1026ab:	68 c0 00 00 00       	push   $0xc0
  jmp __alltraps
  1026b0:	e9 60 f8 ff ff       	jmp    101f15 <__alltraps>

001026b5 <vector193>:
.globl vector193
vector193:
  pushl $0
  1026b5:	6a 00                	push   $0x0
  pushl $193
  1026b7:	68 c1 00 00 00       	push   $0xc1
  jmp __alltraps
  1026bc:	e9 54 f8 ff ff       	jmp    101f15 <__alltraps>

001026c1 <vector194>:
.globl vector194
vector194:
  pushl $0
  1026c1:	6a 00                	push   $0x0
  pushl $194
  1026c3:	68 c2 00 00 00       	push   $0xc2
  jmp __alltraps
  1026c8:	e9 48 f8 ff ff       	jmp    101f15 <__alltraps>

001026cd <vector195>:
.globl vector195
vector195:
  pushl $0
  1026cd:	6a 00                	push   $0x0
  pushl $195
  1026cf:	68 c3 00 00 00       	push   $0xc3
  jmp __alltraps
  1026d4:	e9 3c f8 ff ff       	jmp    101f15 <__alltraps>

001026d9 <vector196>:
.globl vector196
vector196:
  pushl $0
  1026d9:	6a 00                	push   $0x0
  pushl $196
  1026db:	68 c4 00 00 00       	push   $0xc4
  jmp __alltraps
  1026e0:	e9 30 f8 ff ff       	jmp    101f15 <__alltraps>

001026e5 <vector197>:
.globl vector197
vector197:
  pushl $0
  1026e5:	6a 00                	push   $0x0
  pushl $197
  1026e7:	68 c5 00 00 00       	push   $0xc5
  jmp __alltraps
  1026ec:	e9 24 f8 ff ff       	jmp    101f15 <__alltraps>

001026f1 <vector198>:
.globl vector198
vector198:
  pushl $0
  1026f1:	6a 00                	push   $0x0
  pushl $198
  1026f3:	68 c6 00 00 00       	push   $0xc6
  jmp __alltraps
  1026f8:	e9 18 f8 ff ff       	jmp    101f15 <__alltraps>

001026fd <vector199>:
.globl vector199
vector199:
  pushl $0
  1026fd:	6a 00                	push   $0x0
  pushl $199
  1026ff:	68 c7 00 00 00       	push   $0xc7
  jmp __alltraps
  102704:	e9 0c f8 ff ff       	jmp    101f15 <__alltraps>

00102709 <vector200>:
.globl vector200
vector200:
  pushl $0
  102709:	6a 00                	push   $0x0
  pushl $200
  10270b:	68 c8 00 00 00       	push   $0xc8
  jmp __alltraps
  102710:	e9 00 f8 ff ff       	jmp    101f15 <__alltraps>

00102715 <vector201>:
.globl vector201
vector201:
  pushl $0
  102715:	6a 00                	push   $0x0
  pushl $201
  102717:	68 c9 00 00 00       	push   $0xc9
  jmp __alltraps
  10271c:	e9 f4 f7 ff ff       	jmp    101f15 <__alltraps>

00102721 <vector202>:
.globl vector202
vector202:
  pushl $0
  102721:	6a 00                	push   $0x0
  pushl $202
  102723:	68 ca 00 00 00       	push   $0xca
  jmp __alltraps
  102728:	e9 e8 f7 ff ff       	jmp    101f15 <__alltraps>

0010272d <vector203>:
.globl vector203
vector203:
  pushl $0
  10272d:	6a 00                	push   $0x0
  pushl $203
  10272f:	68 cb 00 00 00       	push   $0xcb
  jmp __alltraps
  102734:	e9 dc f7 ff ff       	jmp    101f15 <__alltraps>

00102739 <vector204>:
.globl vector204
vector204:
  pushl $0
  102739:	6a 00                	push   $0x0
  pushl $204
  10273b:	68 cc 00 00 00       	push   $0xcc
  jmp __alltraps
  102740:	e9 d0 f7 ff ff       	jmp    101f15 <__alltraps>

00102745 <vector205>:
.globl vector205
vector205:
  pushl $0
  102745:	6a 00                	push   $0x0
  pushl $205
  102747:	68 cd 00 00 00       	push   $0xcd
  jmp __alltraps
  10274c:	e9 c4 f7 ff ff       	jmp    101f15 <__alltraps>

00102751 <vector206>:
.globl vector206
vector206:
  pushl $0
  102751:	6a 00                	push   $0x0
  pushl $206
  102753:	68 ce 00 00 00       	push   $0xce
  jmp __alltraps
  102758:	e9 b8 f7 ff ff       	jmp    101f15 <__alltraps>

0010275d <vector207>:
.globl vector207
vector207:
  pushl $0
  10275d:	6a 00                	push   $0x0
  pushl $207
  10275f:	68 cf 00 00 00       	push   $0xcf
  jmp __alltraps
  102764:	e9 ac f7 ff ff       	jmp    101f15 <__alltraps>

00102769 <vector208>:
.globl vector208
vector208:
  pushl $0
  102769:	6a 00                	push   $0x0
  pushl $208
  10276b:	68 d0 00 00 00       	push   $0xd0
  jmp __alltraps
  102770:	e9 a0 f7 ff ff       	jmp    101f15 <__alltraps>

00102775 <vector209>:
.globl vector209
vector209:
  pushl $0
  102775:	6a 00                	push   $0x0
  pushl $209
  102777:	68 d1 00 00 00       	push   $0xd1
  jmp __alltraps
  10277c:	e9 94 f7 ff ff       	jmp    101f15 <__alltraps>

00102781 <vector210>:
.globl vector210
vector210:
  pushl $0
  102781:	6a 00                	push   $0x0
  pushl $210
  102783:	68 d2 00 00 00       	push   $0xd2
  jmp __alltraps
  102788:	e9 88 f7 ff ff       	jmp    101f15 <__alltraps>

0010278d <vector211>:
.globl vector211
vector211:
  pushl $0
  10278d:	6a 00                	push   $0x0
  pushl $211
  10278f:	68 d3 00 00 00       	push   $0xd3
  jmp __alltraps
  102794:	e9 7c f7 ff ff       	jmp    101f15 <__alltraps>

00102799 <vector212>:
.globl vector212
vector212:
  pushl $0
  102799:	6a 00                	push   $0x0
  pushl $212
  10279b:	68 d4 00 00 00       	push   $0xd4
  jmp __alltraps
  1027a0:	e9 70 f7 ff ff       	jmp    101f15 <__alltraps>

001027a5 <vector213>:
.globl vector213
vector213:
  pushl $0
  1027a5:	6a 00                	push   $0x0
  pushl $213
  1027a7:	68 d5 00 00 00       	push   $0xd5
  jmp __alltraps
  1027ac:	e9 64 f7 ff ff       	jmp    101f15 <__alltraps>

001027b1 <vector214>:
.globl vector214
vector214:
  pushl $0
  1027b1:	6a 00                	push   $0x0
  pushl $214
  1027b3:	68 d6 00 00 00       	push   $0xd6
  jmp __alltraps
  1027b8:	e9 58 f7 ff ff       	jmp    101f15 <__alltraps>

001027bd <vector215>:
.globl vector215
vector215:
  pushl $0
  1027bd:	6a 00                	push   $0x0
  pushl $215
  1027bf:	68 d7 00 00 00       	push   $0xd7
  jmp __alltraps
  1027c4:	e9 4c f7 ff ff       	jmp    101f15 <__alltraps>

001027c9 <vector216>:
.globl vector216
vector216:
  pushl $0
  1027c9:	6a 00                	push   $0x0
  pushl $216
  1027cb:	68 d8 00 00 00       	push   $0xd8
  jmp __alltraps
  1027d0:	e9 40 f7 ff ff       	jmp    101f15 <__alltraps>

001027d5 <vector217>:
.globl vector217
vector217:
  pushl $0
  1027d5:	6a 00                	push   $0x0
  pushl $217
  1027d7:	68 d9 00 00 00       	push   $0xd9
  jmp __alltraps
  1027dc:	e9 34 f7 ff ff       	jmp    101f15 <__alltraps>

001027e1 <vector218>:
.globl vector218
vector218:
  pushl $0
  1027e1:	6a 00                	push   $0x0
  pushl $218
  1027e3:	68 da 00 00 00       	push   $0xda
  jmp __alltraps
  1027e8:	e9 28 f7 ff ff       	jmp    101f15 <__alltraps>

001027ed <vector219>:
.globl vector219
vector219:
  pushl $0
  1027ed:	6a 00                	push   $0x0
  pushl $219
  1027ef:	68 db 00 00 00       	push   $0xdb
  jmp __alltraps
  1027f4:	e9 1c f7 ff ff       	jmp    101f15 <__alltraps>

001027f9 <vector220>:
.globl vector220
vector220:
  pushl $0
  1027f9:	6a 00                	push   $0x0
  pushl $220
  1027fb:	68 dc 00 00 00       	push   $0xdc
  jmp __alltraps
  102800:	e9 10 f7 ff ff       	jmp    101f15 <__alltraps>

00102805 <vector221>:
.globl vector221
vector221:
  pushl $0
  102805:	6a 00                	push   $0x0
  pushl $221
  102807:	68 dd 00 00 00       	push   $0xdd
  jmp __alltraps
  10280c:	e9 04 f7 ff ff       	jmp    101f15 <__alltraps>

00102811 <vector222>:
.globl vector222
vector222:
  pushl $0
  102811:	6a 00                	push   $0x0
  pushl $222
  102813:	68 de 00 00 00       	push   $0xde
  jmp __alltraps
  102818:	e9 f8 f6 ff ff       	jmp    101f15 <__alltraps>

0010281d <vector223>:
.globl vector223
vector223:
  pushl $0
  10281d:	6a 00                	push   $0x0
  pushl $223
  10281f:	68 df 00 00 00       	push   $0xdf
  jmp __alltraps
  102824:	e9 ec f6 ff ff       	jmp    101f15 <__alltraps>

00102829 <vector224>:
.globl vector224
vector224:
  pushl $0
  102829:	6a 00                	push   $0x0
  pushl $224
  10282b:	68 e0 00 00 00       	push   $0xe0
  jmp __alltraps
  102830:	e9 e0 f6 ff ff       	jmp    101f15 <__alltraps>

00102835 <vector225>:
.globl vector225
vector225:
  pushl $0
  102835:	6a 00                	push   $0x0
  pushl $225
  102837:	68 e1 00 00 00       	push   $0xe1
  jmp __alltraps
  10283c:	e9 d4 f6 ff ff       	jmp    101f15 <__alltraps>

00102841 <vector226>:
.globl vector226
vector226:
  pushl $0
  102841:	6a 00                	push   $0x0
  pushl $226
  102843:	68 e2 00 00 00       	push   $0xe2
  jmp __alltraps
  102848:	e9 c8 f6 ff ff       	jmp    101f15 <__alltraps>

0010284d <vector227>:
.globl vector227
vector227:
  pushl $0
  10284d:	6a 00                	push   $0x0
  pushl $227
  10284f:	68 e3 00 00 00       	push   $0xe3
  jmp __alltraps
  102854:	e9 bc f6 ff ff       	jmp    101f15 <__alltraps>

00102859 <vector228>:
.globl vector228
vector228:
  pushl $0
  102859:	6a 00                	push   $0x0
  pushl $228
  10285b:	68 e4 00 00 00       	push   $0xe4
  jmp __alltraps
  102860:	e9 b0 f6 ff ff       	jmp    101f15 <__alltraps>

00102865 <vector229>:
.globl vector229
vector229:
  pushl $0
  102865:	6a 00                	push   $0x0
  pushl $229
  102867:	68 e5 00 00 00       	push   $0xe5
  jmp __alltraps
  10286c:	e9 a4 f6 ff ff       	jmp    101f15 <__alltraps>

00102871 <vector230>:
.globl vector230
vector230:
  pushl $0
  102871:	6a 00                	push   $0x0
  pushl $230
  102873:	68 e6 00 00 00       	push   $0xe6
  jmp __alltraps
  102878:	e9 98 f6 ff ff       	jmp    101f15 <__alltraps>

0010287d <vector231>:
.globl vector231
vector231:
  pushl $0
  10287d:	6a 00                	push   $0x0
  pushl $231
  10287f:	68 e7 00 00 00       	push   $0xe7
  jmp __alltraps
  102884:	e9 8c f6 ff ff       	jmp    101f15 <__alltraps>

00102889 <vector232>:
.globl vector232
vector232:
  pushl $0
  102889:	6a 00                	push   $0x0
  pushl $232
  10288b:	68 e8 00 00 00       	push   $0xe8
  jmp __alltraps
  102890:	e9 80 f6 ff ff       	jmp    101f15 <__alltraps>

00102895 <vector233>:
.globl vector233
vector233:
  pushl $0
  102895:	6a 00                	push   $0x0
  pushl $233
  102897:	68 e9 00 00 00       	push   $0xe9
  jmp __alltraps
  10289c:	e9 74 f6 ff ff       	jmp    101f15 <__alltraps>

001028a1 <vector234>:
.globl vector234
vector234:
  pushl $0
  1028a1:	6a 00                	push   $0x0
  pushl $234
  1028a3:	68 ea 00 00 00       	push   $0xea
  jmp __alltraps
  1028a8:	e9 68 f6 ff ff       	jmp    101f15 <__alltraps>

001028ad <vector235>:
.globl vector235
vector235:
  pushl $0
  1028ad:	6a 00                	push   $0x0
  pushl $235
  1028af:	68 eb 00 00 00       	push   $0xeb
  jmp __alltraps
  1028b4:	e9 5c f6 ff ff       	jmp    101f15 <__alltraps>

001028b9 <vector236>:
.globl vector236
vector236:
  pushl $0
  1028b9:	6a 00                	push   $0x0
  pushl $236
  1028bb:	68 ec 00 00 00       	push   $0xec
  jmp __alltraps
  1028c0:	e9 50 f6 ff ff       	jmp    101f15 <__alltraps>

001028c5 <vector237>:
.globl vector237
vector237:
  pushl $0
  1028c5:	6a 00                	push   $0x0
  pushl $237
  1028c7:	68 ed 00 00 00       	push   $0xed
  jmp __alltraps
  1028cc:	e9 44 f6 ff ff       	jmp    101f15 <__alltraps>

001028d1 <vector238>:
.globl vector238
vector238:
  pushl $0
  1028d1:	6a 00                	push   $0x0
  pushl $238
  1028d3:	68 ee 00 00 00       	push   $0xee
  jmp __alltraps
  1028d8:	e9 38 f6 ff ff       	jmp    101f15 <__alltraps>

001028dd <vector239>:
.globl vector239
vector239:
  pushl $0
  1028dd:	6a 00                	push   $0x0
  pushl $239
  1028df:	68 ef 00 00 00       	push   $0xef
  jmp __alltraps
  1028e4:	e9 2c f6 ff ff       	jmp    101f15 <__alltraps>

001028e9 <vector240>:
.globl vector240
vector240:
  pushl $0
  1028e9:	6a 00                	push   $0x0
  pushl $240
  1028eb:	68 f0 00 00 00       	push   $0xf0
  jmp __alltraps
  1028f0:	e9 20 f6 ff ff       	jmp    101f15 <__alltraps>

001028f5 <vector241>:
.globl vector241
vector241:
  pushl $0
  1028f5:	6a 00                	push   $0x0
  pushl $241
  1028f7:	68 f1 00 00 00       	push   $0xf1
  jmp __alltraps
  1028fc:	e9 14 f6 ff ff       	jmp    101f15 <__alltraps>

00102901 <vector242>:
.globl vector242
vector242:
  pushl $0
  102901:	6a 00                	push   $0x0
  pushl $242
  102903:	68 f2 00 00 00       	push   $0xf2
  jmp __alltraps
  102908:	e9 08 f6 ff ff       	jmp    101f15 <__alltraps>

0010290d <vector243>:
.globl vector243
vector243:
  pushl $0
  10290d:	6a 00                	push   $0x0
  pushl $243
  10290f:	68 f3 00 00 00       	push   $0xf3
  jmp __alltraps
  102914:	e9 fc f5 ff ff       	jmp    101f15 <__alltraps>

00102919 <vector244>:
.globl vector244
vector244:
  pushl $0
  102919:	6a 00                	push   $0x0
  pushl $244
  10291b:	68 f4 00 00 00       	push   $0xf4
  jmp __alltraps
  102920:	e9 f0 f5 ff ff       	jmp    101f15 <__alltraps>

00102925 <vector245>:
.globl vector245
vector245:
  pushl $0
  102925:	6a 00                	push   $0x0
  pushl $245
  102927:	68 f5 00 00 00       	push   $0xf5
  jmp __alltraps
  10292c:	e9 e4 f5 ff ff       	jmp    101f15 <__alltraps>

00102931 <vector246>:
.globl vector246
vector246:
  pushl $0
  102931:	6a 00                	push   $0x0
  pushl $246
  102933:	68 f6 00 00 00       	push   $0xf6
  jmp __alltraps
  102938:	e9 d8 f5 ff ff       	jmp    101f15 <__alltraps>

0010293d <vector247>:
.globl vector247
vector247:
  pushl $0
  10293d:	6a 00                	push   $0x0
  pushl $247
  10293f:	68 f7 00 00 00       	push   $0xf7
  jmp __alltraps
  102944:	e9 cc f5 ff ff       	jmp    101f15 <__alltraps>

00102949 <vector248>:
.globl vector248
vector248:
  pushl $0
  102949:	6a 00                	push   $0x0
  pushl $248
  10294b:	68 f8 00 00 00       	push   $0xf8
  jmp __alltraps
  102950:	e9 c0 f5 ff ff       	jmp    101f15 <__alltraps>

00102955 <vector249>:
.globl vector249
vector249:
  pushl $0
  102955:	6a 00                	push   $0x0
  pushl $249
  102957:	68 f9 00 00 00       	push   $0xf9
  jmp __alltraps
  10295c:	e9 b4 f5 ff ff       	jmp    101f15 <__alltraps>

00102961 <vector250>:
.globl vector250
vector250:
  pushl $0
  102961:	6a 00                	push   $0x0
  pushl $250
  102963:	68 fa 00 00 00       	push   $0xfa
  jmp __alltraps
  102968:	e9 a8 f5 ff ff       	jmp    101f15 <__alltraps>

0010296d <vector251>:
.globl vector251
vector251:
  pushl $0
  10296d:	6a 00                	push   $0x0
  pushl $251
  10296f:	68 fb 00 00 00       	push   $0xfb
  jmp __alltraps
  102974:	e9 9c f5 ff ff       	jmp    101f15 <__alltraps>

00102979 <vector252>:
.globl vector252
vector252:
  pushl $0
  102979:	6a 00                	push   $0x0
  pushl $252
  10297b:	68 fc 00 00 00       	push   $0xfc
  jmp __alltraps
  102980:	e9 90 f5 ff ff       	jmp    101f15 <__alltraps>

00102985 <vector253>:
.globl vector253
vector253:
  pushl $0
  102985:	6a 00                	push   $0x0
  pushl $253
  102987:	68 fd 00 00 00       	push   $0xfd
  jmp __alltraps
  10298c:	e9 84 f5 ff ff       	jmp    101f15 <__alltraps>

00102991 <vector254>:
.globl vector254
vector254:
  pushl $0
  102991:	6a 00                	push   $0x0
  pushl $254
  102993:	68 fe 00 00 00       	push   $0xfe
  jmp __alltraps
  102998:	e9 78 f5 ff ff       	jmp    101f15 <__alltraps>

0010299d <vector255>:
.globl vector255
vector255:
  pushl $0
  10299d:	6a 00                	push   $0x0
  pushl $255
  10299f:	68 ff 00 00 00       	push   $0xff
  jmp __alltraps
  1029a4:	e9 6c f5 ff ff       	jmp    101f15 <__alltraps>

001029a9 <page2ppn>:

extern struct Page *pages;
extern size_t npage;

static inline ppn_t
page2ppn(struct Page *page) {
  1029a9:	55                   	push   %ebp
  1029aa:	89 e5                	mov    %esp,%ebp
    return page - pages;
  1029ac:	8b 15 00 cf 11 00    	mov    0x11cf00,%edx
  1029b2:	8b 45 08             	mov    0x8(%ebp),%eax
  1029b5:	29 d0                	sub    %edx,%eax
  1029b7:	c1 f8 02             	sar    $0x2,%eax
  1029ba:	69 c0 cd cc cc cc    	imul   $0xcccccccd,%eax,%eax
}
  1029c0:	5d                   	pop    %ebp
  1029c1:	c3                   	ret    

001029c2 <page2pa>:

static inline uintptr_t
page2pa(struct Page *page) {
  1029c2:	55                   	push   %ebp
  1029c3:	89 e5                	mov    %esp,%ebp
  1029c5:	83 ec 04             	sub    $0x4,%esp
    return page2ppn(page) << PGSHIFT;
  1029c8:	8b 45 08             	mov    0x8(%ebp),%eax
  1029cb:	89 04 24             	mov    %eax,(%esp)
  1029ce:	e8 d6 ff ff ff       	call   1029a9 <page2ppn>
  1029d3:	c1 e0 0c             	shl    $0xc,%eax
}
  1029d6:	89 ec                	mov    %ebp,%esp
  1029d8:	5d                   	pop    %ebp
  1029d9:	c3                   	ret    

001029da <page_ref>:
pde2page(pde_t pde) {
    return pa2page(PDE_ADDR(pde));
}

static inline int
page_ref(struct Page *page) {
  1029da:	55                   	push   %ebp
  1029db:	89 e5                	mov    %esp,%ebp
    return page->ref;
  1029dd:	8b 45 08             	mov    0x8(%ebp),%eax
  1029e0:	8b 00                	mov    (%eax),%eax
}
  1029e2:	5d                   	pop    %ebp
  1029e3:	c3                   	ret    

001029e4 <set_page_ref>:

static inline void
set_page_ref(struct Page *page, int val) {
  1029e4:	55                   	push   %ebp
  1029e5:	89 e5                	mov    %esp,%ebp
    page->ref = val;
  1029e7:	8b 45 08             	mov    0x8(%ebp),%eax
  1029ea:	8b 55 0c             	mov    0xc(%ebp),%edx
  1029ed:	89 10                	mov    %edx,(%eax)
}
  1029ef:	90                   	nop
  1029f0:	5d                   	pop    %ebp
  1029f1:	c3                   	ret    

001029f2 <default_init>:
#define nr_free (free_area.nr_free)

//free_list` 用于记录空闲内存块,nr_free` 是空闲内存块的总数。
//用default_init函数来初始化 `free_list`,并将 `nr_free` 设置为 0。
static void
default_init(void) {
  1029f2:	55                   	push   %ebp
  1029f3:	89 e5                	mov    %esp,%ebp
  1029f5:	83 ec 10             	sub    $0x10,%esp
  1029f8:	c7 45 fc e0 ce 11 00 	movl   $0x11cee0,-0x4(%ebp)
 * list_init - initialize a new entry
 * @elm:        new entry to be initialized
 * */
static inline void
list_init(list_entry_t *elm) {
    elm->prev = elm->next = elm;
  1029ff:	8b 45 fc             	mov    -0x4(%ebp),%eax
  102a02:	8b 55 fc             	mov    -0x4(%ebp),%edx
  102a05:	89 50 04             	mov    %edx,0x4(%eax)
  102a08:	8b 45 fc             	mov    -0x4(%ebp),%eax
  102a0b:	8b 50 04             	mov    0x4(%eax),%edx
  102a0e:	8b 45 fc             	mov    -0x4(%ebp),%eax
  102a11:	89 10                	mov    %edx,(%eax)
}
  102a13:	90                   	nop
    list_init(&free_list);
    nr_free = 0;
  102a14:	c7 05 e8 ce 11 00 00 	movl   $0x0,0x11cee8
  102a1b:	00 00 00 
}
  102a1e:	90                   	nop
  102a1f:	89 ec                	mov    %ebp,%esp
  102a21:	5d                   	pop    %ebp
  102a22:	c3                   	ret    

00102a23 <default_init_memmap>:

//用于初始化一段连续的物理页，并将它们加入到空闲内存管理系统中.
//struct Page *base：指向要初始化的页块的起始地址。size_t n：要初始化的页的数量。
static void
default_init_memmap(struct Page *base, size_t n) {
  102a23:	55                   	push   %ebp
  102a24:	89 e5                	mov    %esp,%ebp
  102a26:	83 ec 48             	sub    $0x48,%esp
    assert(n > 0);//// 确保请求的页数大于零
  102a29:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
  102a2d:	75 24                	jne    102a53 <default_init_memmap+0x30>
  102a2f:	c7 44 24 0c d0 67 10 	movl   $0x1067d0,0xc(%esp)
  102a36:	00 
  102a37:	c7 44 24 08 d6 67 10 	movl   $0x1067d6,0x8(%esp)
  102a3e:	00 
  102a3f:	c7 44 24 04 94 00 00 	movl   $0x94,0x4(%esp)
  102a46:	00 
  102a47:	c7 04 24 eb 67 10 00 	movl   $0x1067eb,(%esp)
  102a4e:	e8 e0 e1 ff ff       	call   100c33 <__panic>
    struct Page *p = base;// 指向当前初始化的页
  102a53:	8b 45 08             	mov    0x8(%ebp),%eax
  102a56:	89 45 f4             	mov    %eax,-0xc(%ebp)
    //// 遍历每一页，设置其状态
    for (; p != base + n; p ++) {
  102a59:	eb 7d                	jmp    102ad8 <default_init_memmap+0xb5>
        assert(PageReserved(p));//检查每个页是否被标记为“保留”。若没有被保留，函数将抛出错误。
  102a5b:	8b 45 f4             	mov    -0xc(%ebp),%eax
  102a5e:	83 c0 04             	add    $0x4,%eax
  102a61:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
  102a68:	89 45 ec             	mov    %eax,-0x14(%ebp)
 * @addr:   the address to count from
 * */
static inline bool
test_bit(int nr, volatile void *addr) {
    int oldbit;
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
  102a6b:	8b 45 ec             	mov    -0x14(%ebp),%eax
  102a6e:	8b 55 f0             	mov    -0x10(%ebp),%edx
  102a71:	0f a3 10             	bt     %edx,(%eax)
  102a74:	19 c0                	sbb    %eax,%eax
  102a76:	89 45 e8             	mov    %eax,-0x18(%ebp)
    return oldbit != 0;
  102a79:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
  102a7d:	0f 95 c0             	setne  %al
  102a80:	0f b6 c0             	movzbl %al,%eax
  102a83:	85 c0                	test   %eax,%eax
  102a85:	75 24                	jne    102aab <default_init_memmap+0x88>
  102a87:	c7 44 24 0c 01 68 10 	movl   $0x106801,0xc(%esp)
  102a8e:	00 
  102a8f:	c7 44 24 08 d6 67 10 	movl   $0x1067d6,0x8(%esp)
  102a96:	00 
  102a97:	c7 44 24 04 98 00 00 	movl   $0x98,0x4(%esp)
  102a9e:	00 
  102a9f:	c7 04 24 eb 67 10 00 	movl   $0x1067eb,(%esp)
  102aa6:	e8 88 e1 ff ff       	call   100c33 <__panic>
        p->flags = p->property = 0;//将页的 flags 和 property 字段设置为 0，表示该页未分配、未使用。
  102aab:	8b 45 f4             	mov    -0xc(%ebp),%eax
  102aae:	c7 40 08 00 00 00 00 	movl   $0x0,0x8(%eax)
  102ab5:	8b 45 f4             	mov    -0xc(%ebp),%eax
  102ab8:	8b 50 08             	mov    0x8(%eax),%edx
  102abb:	8b 45 f4             	mov    -0xc(%ebp),%eax
  102abe:	89 50 04             	mov    %edx,0x4(%eax)
        set_page_ref(p, 0);//将页的引用计数设置为 0，表明没有任何引用指向此页。
  102ac1:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  102ac8:	00 
  102ac9:	8b 45 f4             	mov    -0xc(%ebp),%eax
  102acc:	89 04 24             	mov    %eax,(%esp)
  102acf:	e8 10 ff ff ff       	call   1029e4 <set_page_ref>
    for (; p != base + n; p ++) {
  102ad4:	83 45 f4 14          	addl   $0x14,-0xc(%ebp)
  102ad8:	8b 55 0c             	mov    0xc(%ebp),%edx
  102adb:	89 d0                	mov    %edx,%eax
  102add:	c1 e0 02             	shl    $0x2,%eax
  102ae0:	01 d0                	add    %edx,%eax
  102ae2:	c1 e0 02             	shl    $0x2,%eax
  102ae5:	89 c2                	mov    %eax,%edx
  102ae7:	8b 45 08             	mov    0x8(%ebp),%eax
  102aea:	01 d0                	add    %edx,%eax
  102aec:	39 45 f4             	cmp    %eax,-0xc(%ebp)
  102aef:	0f 85 66 ff ff ff    	jne    102a5b <default_init_memmap+0x38>
    }
    // 设置第一个页的 property 为块的总数
    base->property = n;
  102af5:	8b 45 08             	mov    0x8(%ebp),%eax
  102af8:	8b 55 0c             	mov    0xc(%ebp),%edx
  102afb:	89 50 08             	mov    %edx,0x8(%eax)
    SetPageProperty(base);// 设置当前页的有效标志
  102afe:	8b 45 08             	mov    0x8(%ebp),%eax
  102b01:	83 c0 04             	add    $0x4,%eax
  102b04:	c7 45 d0 01 00 00 00 	movl   $0x1,-0x30(%ebp)
  102b0b:	89 45 cc             	mov    %eax,-0x34(%ebp)
    asm volatile ("btsl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
  102b0e:	8b 45 cc             	mov    -0x34(%ebp),%eax
  102b11:	8b 55 d0             	mov    -0x30(%ebp),%edx
  102b14:	0f ab 10             	bts    %edx,(%eax)
}
  102b17:	90                   	nop
    nr_free += n;// 更新空闲页计数
  102b18:	8b 15 e8 ce 11 00    	mov    0x11cee8,%edx
  102b1e:	8b 45 0c             	mov    0xc(%ebp),%eax
  102b21:	01 d0                	add    %edx,%eax
  102b23:	a3 e8 ce 11 00       	mov    %eax,0x11cee8
    list_add_before(&free_list, &(base->page_link)); // 将该块添加到空闲列表中
  102b28:	8b 45 08             	mov    0x8(%ebp),%eax
  102b2b:	83 c0 0c             	add    $0xc,%eax
  102b2e:	c7 45 e4 e0 ce 11 00 	movl   $0x11cee0,-0x1c(%ebp)
  102b35:	89 45 e0             	mov    %eax,-0x20(%ebp)
 * Insert the new element @elm *before* the element @listelm which
 * is already in the list.
 * */
static inline void
list_add_before(list_entry_t *listelm, list_entry_t *elm) {
    __list_add(elm, listelm->prev, listelm);
  102b38:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  102b3b:	8b 00                	mov    (%eax),%eax
  102b3d:	8b 55 e0             	mov    -0x20(%ebp),%edx
  102b40:	89 55 dc             	mov    %edx,-0x24(%ebp)
  102b43:	89 45 d8             	mov    %eax,-0x28(%ebp)
  102b46:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  102b49:	89 45 d4             	mov    %eax,-0x2c(%ebp)
 * This is only for internal list manipulation where we know
 * the prev/next entries already!
 * */
static inline void
__list_add(list_entry_t *elm, list_entry_t *prev, list_entry_t *next) {
    prev->next = next->prev = elm;
  102b4c:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  102b4f:	8b 55 dc             	mov    -0x24(%ebp),%edx
  102b52:	89 10                	mov    %edx,(%eax)
  102b54:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  102b57:	8b 10                	mov    (%eax),%edx
  102b59:	8b 45 d8             	mov    -0x28(%ebp),%eax
  102b5c:	89 50 04             	mov    %edx,0x4(%eax)
    elm->next = next;
  102b5f:	8b 45 dc             	mov    -0x24(%ebp),%eax
  102b62:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  102b65:	89 50 04             	mov    %edx,0x4(%eax)
    elm->prev = prev;
  102b68:	8b 45 dc             	mov    -0x24(%ebp),%eax
  102b6b:	8b 55 d8             	mov    -0x28(%ebp),%edx
  102b6e:	89 10                	mov    %edx,(%eax)
}
  102b70:	90                   	nop
}
  102b71:	90                   	nop
}
  102b72:	90                   	nop
  102b73:	89 ec                	mov    %ebp,%esp
  102b75:	5d                   	pop    %ebp
  102b76:	c3                   	ret    

00102b77 <default_alloc_pages>:

//用于分配指定数量的连续物理页。该函数实现了首次适应内存分配算法。
static struct Page *
default_alloc_pages(size_t n) {
  102b77:	55                   	push   %ebp
  102b78:	89 e5                	mov    %esp,%ebp
  102b7a:	83 ec 68             	sub    $0x68,%esp
    assert(n > 0);// 确保请求的页数大于零
  102b7d:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
  102b81:	75 24                	jne    102ba7 <default_alloc_pages+0x30>
  102b83:	c7 44 24 0c d0 67 10 	movl   $0x1067d0,0xc(%esp)
  102b8a:	00 
  102b8b:	c7 44 24 08 d6 67 10 	movl   $0x1067d6,0x8(%esp)
  102b92:	00 
  102b93:	c7 44 24 04 a6 00 00 	movl   $0xa6,0x4(%esp)
  102b9a:	00 
  102b9b:	c7 04 24 eb 67 10 00 	movl   $0x1067eb,(%esp)
  102ba2:	e8 8c e0 ff ff       	call   100c33 <__panic>
    if (n > nr_free) {// 检查请求的页数是否超过空闲页数
  102ba7:	a1 e8 ce 11 00       	mov    0x11cee8,%eax
  102bac:	39 45 08             	cmp    %eax,0x8(%ebp)
  102baf:	76 0a                	jbe    102bbb <default_alloc_pages+0x44>
        return NULL;
  102bb1:	b8 00 00 00 00       	mov    $0x0,%eax
  102bb6:	e9 43 01 00 00       	jmp    102cfe <default_alloc_pages+0x187>
    }
    struct Page *page = NULL;// 初始化分配的页指针
  102bbb:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    list_entry_t *le = &free_list; // 初始化链表迭代器
  102bc2:	c7 45 f0 e0 ce 11 00 	movl   $0x11cee0,-0x10(%ebp)
    // 遍历空闲列表，寻找第一个满足条件的块
    while ((le = list_next(le)) != &free_list) {
  102bc9:	eb 1c                	jmp    102be7 <default_alloc_pages+0x70>
        struct Page *p = le2page(le, page_link);// 将链表节点转换为 Page 结构体
  102bcb:	8b 45 f0             	mov    -0x10(%ebp),%eax
  102bce:	83 e8 0c             	sub    $0xc,%eax
  102bd1:	89 45 ec             	mov    %eax,-0x14(%ebp)
        if (p->property >= n) {// 检查当前块的页数是否满足请求
  102bd4:	8b 45 ec             	mov    -0x14(%ebp),%eax
  102bd7:	8b 40 08             	mov    0x8(%eax),%eax
  102bda:	39 45 08             	cmp    %eax,0x8(%ebp)
  102bdd:	77 08                	ja     102be7 <default_alloc_pages+0x70>
            page = p;// 找到合适的块
  102bdf:	8b 45 ec             	mov    -0x14(%ebp),%eax
  102be2:	89 45 f4             	mov    %eax,-0xc(%ebp)
            break;// 退出循环
  102be5:	eb 18                	jmp    102bff <default_alloc_pages+0x88>
  102be7:	8b 45 f0             	mov    -0x10(%ebp),%eax
  102bea:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    return listelm->next;
  102bed:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  102bf0:	8b 40 04             	mov    0x4(%eax),%eax
    while ((le = list_next(le)) != &free_list) {
  102bf3:	89 45 f0             	mov    %eax,-0x10(%ebp)
  102bf6:	81 7d f0 e0 ce 11 00 	cmpl   $0x11cee0,-0x10(%ebp)
  102bfd:	75 cc                	jne    102bcb <default_alloc_pages+0x54>
        }
    }
    if (page != NULL) {// 如果找到合适的块
  102bff:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
  102c03:	0f 84 f2 00 00 00    	je     102cfb <default_alloc_pages+0x184>
        //list_del(&(page->page_link));// 从空闲列表中删除该块
        if (page->property > n) {
  102c09:	8b 45 f4             	mov    -0xc(%ebp),%eax
  102c0c:	8b 40 08             	mov    0x8(%eax),%eax
  102c0f:	39 45 08             	cmp    %eax,0x8(%ebp)
  102c12:	0f 83 8f 00 00 00    	jae    102ca7 <default_alloc_pages+0x130>
            struct Page *p = page + n; // 指向剩余的页
  102c18:	8b 55 08             	mov    0x8(%ebp),%edx
  102c1b:	89 d0                	mov    %edx,%eax
  102c1d:	c1 e0 02             	shl    $0x2,%eax
  102c20:	01 d0                	add    %edx,%eax
  102c22:	c1 e0 02             	shl    $0x2,%eax
  102c25:	89 c2                	mov    %eax,%edx
  102c27:	8b 45 f4             	mov    -0xc(%ebp),%eax
  102c2a:	01 d0                	add    %edx,%eax
  102c2c:	89 45 e8             	mov    %eax,-0x18(%ebp)
            p->property = page->property - n;// 更新剩余块的页数
  102c2f:	8b 45 f4             	mov    -0xc(%ebp),%eax
  102c32:	8b 40 08             	mov    0x8(%eax),%eax
  102c35:	2b 45 08             	sub    0x8(%ebp),%eax
  102c38:	89 c2                	mov    %eax,%edx
  102c3a:	8b 45 e8             	mov    -0x18(%ebp),%eax
  102c3d:	89 50 08             	mov    %edx,0x8(%eax)
            SetPageProperty(p);
  102c40:	8b 45 e8             	mov    -0x18(%ebp),%eax
  102c43:	83 c0 04             	add    $0x4,%eax
  102c46:	c7 45 cc 01 00 00 00 	movl   $0x1,-0x34(%ebp)
  102c4d:	89 45 c8             	mov    %eax,-0x38(%ebp)
    asm volatile ("btsl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
  102c50:	8b 45 c8             	mov    -0x38(%ebp),%eax
  102c53:	8b 55 cc             	mov    -0x34(%ebp),%edx
  102c56:	0f ab 10             	bts    %edx,(%eax)
}
  102c59:	90                   	nop
            list_add_after(&(page->page_link), &(p->page_link));// 将剩余块添加回空闲列表
  102c5a:	8b 45 e8             	mov    -0x18(%ebp),%eax
  102c5d:	83 c0 0c             	add    $0xc,%eax
  102c60:	8b 55 f4             	mov    -0xc(%ebp),%edx
  102c63:	83 c2 0c             	add    $0xc,%edx
  102c66:	89 55 e0             	mov    %edx,-0x20(%ebp)
  102c69:	89 45 dc             	mov    %eax,-0x24(%ebp)
    __list_add(elm, listelm, listelm->next);
  102c6c:	8b 45 e0             	mov    -0x20(%ebp),%eax
  102c6f:	8b 40 04             	mov    0x4(%eax),%eax
  102c72:	8b 55 dc             	mov    -0x24(%ebp),%edx
  102c75:	89 55 d8             	mov    %edx,-0x28(%ebp)
  102c78:	8b 55 e0             	mov    -0x20(%ebp),%edx
  102c7b:	89 55 d4             	mov    %edx,-0x2c(%ebp)
  102c7e:	89 45 d0             	mov    %eax,-0x30(%ebp)
    prev->next = next->prev = elm;
  102c81:	8b 45 d0             	mov    -0x30(%ebp),%eax
  102c84:	8b 55 d8             	mov    -0x28(%ebp),%edx
  102c87:	89 10                	mov    %edx,(%eax)
  102c89:	8b 45 d0             	mov    -0x30(%ebp),%eax
  102c8c:	8b 10                	mov    (%eax),%edx
  102c8e:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  102c91:	89 50 04             	mov    %edx,0x4(%eax)
    elm->next = next;
  102c94:	8b 45 d8             	mov    -0x28(%ebp),%eax
  102c97:	8b 55 d0             	mov    -0x30(%ebp),%edx
  102c9a:	89 50 04             	mov    %edx,0x4(%eax)
    elm->prev = prev;
  102c9d:	8b 45 d8             	mov    -0x28(%ebp),%eax
  102ca0:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  102ca3:	89 10                	mov    %edx,(%eax)
}
  102ca5:	90                   	nop
}
  102ca6:	90                   	nop
    }
        list_del(&(page->page_link));
  102ca7:	8b 45 f4             	mov    -0xc(%ebp),%eax
  102caa:	83 c0 0c             	add    $0xc,%eax
  102cad:	89 45 bc             	mov    %eax,-0x44(%ebp)
    __list_del(listelm->prev, listelm->next);
  102cb0:	8b 45 bc             	mov    -0x44(%ebp),%eax
  102cb3:	8b 40 04             	mov    0x4(%eax),%eax
  102cb6:	8b 55 bc             	mov    -0x44(%ebp),%edx
  102cb9:	8b 12                	mov    (%edx),%edx
  102cbb:	89 55 b8             	mov    %edx,-0x48(%ebp)
  102cbe:	89 45 b4             	mov    %eax,-0x4c(%ebp)
 * This is only for internal list manipulation where we know
 * the prev/next entries already!
 * */
static inline void
__list_del(list_entry_t *prev, list_entry_t *next) {
    prev->next = next;
  102cc1:	8b 45 b8             	mov    -0x48(%ebp),%eax
  102cc4:	8b 55 b4             	mov    -0x4c(%ebp),%edx
  102cc7:	89 50 04             	mov    %edx,0x4(%eax)
    next->prev = prev;
  102cca:	8b 45 b4             	mov    -0x4c(%ebp),%eax
  102ccd:	8b 55 b8             	mov    -0x48(%ebp),%edx
  102cd0:	89 10                	mov    %edx,(%eax)
}
  102cd2:	90                   	nop
}
  102cd3:	90                   	nop
        nr_free -= n;// 减少空闲页的计数
  102cd4:	a1 e8 ce 11 00       	mov    0x11cee8,%eax
  102cd9:	2b 45 08             	sub    0x8(%ebp),%eax
  102cdc:	a3 e8 ce 11 00       	mov    %eax,0x11cee8
        ClearPageProperty(page); // 清除已分配页的属性
  102ce1:	8b 45 f4             	mov    -0xc(%ebp),%eax
  102ce4:	83 c0 04             	add    $0x4,%eax
  102ce7:	c7 45 c4 01 00 00 00 	movl   $0x1,-0x3c(%ebp)
  102cee:	89 45 c0             	mov    %eax,-0x40(%ebp)
    asm volatile ("btrl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
  102cf1:	8b 45 c0             	mov    -0x40(%ebp),%eax
  102cf4:	8b 55 c4             	mov    -0x3c(%ebp),%edx
  102cf7:	0f b3 10             	btr    %edx,(%eax)
}
  102cfa:	90                   	nop
    }
    return page;// 返回分配的页块
  102cfb:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
  102cfe:	89 ec                	mov    %ebp,%esp
  102d00:	5d                   	pop    %ebp
  102d01:	c3                   	ret    

00102d02 <default_free_pages>:

static void
default_free_pages(struct Page *base, size_t n) {
  102d02:	55                   	push   %ebp
  102d03:	89 e5                	mov    %esp,%ebp
  102d05:	81 ec 98 00 00 00    	sub    $0x98,%esp
    assert(n > 0);// 确保请求释放的页数大于零
  102d0b:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
  102d0f:	75 24                	jne    102d35 <default_free_pages+0x33>
  102d11:	c7 44 24 0c d0 67 10 	movl   $0x1067d0,0xc(%esp)
  102d18:	00 
  102d19:	c7 44 24 08 d6 67 10 	movl   $0x1067d6,0x8(%esp)
  102d20:	00 
  102d21:	c7 44 24 04 c5 00 00 	movl   $0xc5,0x4(%esp)
  102d28:	00 
  102d29:	c7 04 24 eb 67 10 00 	movl   $0x1067eb,(%esp)
  102d30:	e8 fe de ff ff       	call   100c33 <__panic>
    struct Page *p = base;
  102d35:	8b 45 08             	mov    0x8(%ebp),%eax
  102d38:	89 45 f4             	mov    %eax,-0xc(%ebp)
    // 遍历释放的页，检查状态并重置
    for (; p != base + n; p ++) {
  102d3b:	e9 9d 00 00 00       	jmp    102ddd <default_free_pages+0xdb>
        assert(!PageReserved(p) && !PageProperty(p)); // 确保页没有被保留并且没有属性
  102d40:	8b 45 f4             	mov    -0xc(%ebp),%eax
  102d43:	83 c0 04             	add    $0x4,%eax
  102d46:	c7 45 ec 00 00 00 00 	movl   $0x0,-0x14(%ebp)
  102d4d:	89 45 e8             	mov    %eax,-0x18(%ebp)
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
  102d50:	8b 45 e8             	mov    -0x18(%ebp),%eax
  102d53:	8b 55 ec             	mov    -0x14(%ebp),%edx
  102d56:	0f a3 10             	bt     %edx,(%eax)
  102d59:	19 c0                	sbb    %eax,%eax
  102d5b:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    return oldbit != 0;
  102d5e:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
  102d62:	0f 95 c0             	setne  %al
  102d65:	0f b6 c0             	movzbl %al,%eax
  102d68:	85 c0                	test   %eax,%eax
  102d6a:	75 2c                	jne    102d98 <default_free_pages+0x96>
  102d6c:	8b 45 f4             	mov    -0xc(%ebp),%eax
  102d6f:	83 c0 04             	add    $0x4,%eax
  102d72:	c7 45 e0 01 00 00 00 	movl   $0x1,-0x20(%ebp)
  102d79:	89 45 dc             	mov    %eax,-0x24(%ebp)
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
  102d7c:	8b 45 dc             	mov    -0x24(%ebp),%eax
  102d7f:	8b 55 e0             	mov    -0x20(%ebp),%edx
  102d82:	0f a3 10             	bt     %edx,(%eax)
  102d85:	19 c0                	sbb    %eax,%eax
  102d87:	89 45 d8             	mov    %eax,-0x28(%ebp)
    return oldbit != 0;
  102d8a:	83 7d d8 00          	cmpl   $0x0,-0x28(%ebp)
  102d8e:	0f 95 c0             	setne  %al
  102d91:	0f b6 c0             	movzbl %al,%eax
  102d94:	85 c0                	test   %eax,%eax
  102d96:	74 24                	je     102dbc <default_free_pages+0xba>
  102d98:	c7 44 24 0c 14 68 10 	movl   $0x106814,0xc(%esp)
  102d9f:	00 
  102da0:	c7 44 24 08 d6 67 10 	movl   $0x1067d6,0x8(%esp)
  102da7:	00 
  102da8:	c7 44 24 04 c9 00 00 	movl   $0xc9,0x4(%esp)
  102daf:	00 
  102db0:	c7 04 24 eb 67 10 00 	movl   $0x1067eb,(%esp)
  102db7:	e8 77 de ff ff       	call   100c33 <__panic>
        p->flags = 0;// 清除 flags 字段
  102dbc:	8b 45 f4             	mov    -0xc(%ebp),%eax
  102dbf:	c7 40 04 00 00 00 00 	movl   $0x0,0x4(%eax)
        set_page_ref(p, 0);// 清除引用计数
  102dc6:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  102dcd:	00 
  102dce:	8b 45 f4             	mov    -0xc(%ebp),%eax
  102dd1:	89 04 24             	mov    %eax,(%esp)
  102dd4:	e8 0b fc ff ff       	call   1029e4 <set_page_ref>
    for (; p != base + n; p ++) {
  102dd9:	83 45 f4 14          	addl   $0x14,-0xc(%ebp)
  102ddd:	8b 55 0c             	mov    0xc(%ebp),%edx
  102de0:	89 d0                	mov    %edx,%eax
  102de2:	c1 e0 02             	shl    $0x2,%eax
  102de5:	01 d0                	add    %edx,%eax
  102de7:	c1 e0 02             	shl    $0x2,%eax
  102dea:	89 c2                	mov    %eax,%edx
  102dec:	8b 45 08             	mov    0x8(%ebp),%eax
  102def:	01 d0                	add    %edx,%eax
  102df1:	39 45 f4             	cmp    %eax,-0xc(%ebp)
  102df4:	0f 85 46 ff ff ff    	jne    102d40 <default_free_pages+0x3e>
    }
    // 设置基页的属性为释放的页数
    base->property = n;
  102dfa:	8b 45 08             	mov    0x8(%ebp),%eax
  102dfd:	8b 55 0c             	mov    0xc(%ebp),%edx
  102e00:	89 50 08             	mov    %edx,0x8(%eax)
    SetPageProperty(base);// 设置页的有效标志
  102e03:	8b 45 08             	mov    0x8(%ebp),%eax
  102e06:	83 c0 04             	add    $0x4,%eax
  102e09:	c7 45 d0 01 00 00 00 	movl   $0x1,-0x30(%ebp)
  102e10:	89 45 cc             	mov    %eax,-0x34(%ebp)
    asm volatile ("btsl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
  102e13:	8b 45 cc             	mov    -0x34(%ebp),%eax
  102e16:	8b 55 d0             	mov    -0x30(%ebp),%edx
  102e19:	0f ab 10             	bts    %edx,(%eax)
}
  102e1c:	90                   	nop
  102e1d:	c7 45 d4 e0 ce 11 00 	movl   $0x11cee0,-0x2c(%ebp)
    return listelm->next;
  102e24:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  102e27:	8b 40 04             	mov    0x4(%eax),%eax
    // 遍历空闲列表，检查是否需要合并
    list_entry_t *le = list_next(&free_list);
  102e2a:	89 45 f0             	mov    %eax,-0x10(%ebp)
    while (le != &free_list) {
  102e2d:	e9 0e 01 00 00       	jmp    102f40 <default_free_pages+0x23e>
        p = le2page(le, page_link);
  102e32:	8b 45 f0             	mov    -0x10(%ebp),%eax
  102e35:	83 e8 0c             	sub    $0xc,%eax
  102e38:	89 45 f4             	mov    %eax,-0xc(%ebp)
  102e3b:	8b 45 f0             	mov    -0x10(%ebp),%eax
  102e3e:	89 45 c8             	mov    %eax,-0x38(%ebp)
  102e41:	8b 45 c8             	mov    -0x38(%ebp),%eax
  102e44:	8b 40 04             	mov    0x4(%eax),%eax
        le = list_next(le);
  102e47:	89 45 f0             	mov    %eax,-0x10(%ebp)
        // 如果当前页块与释放的页块相邻，合并
        if (base + base->property == p) {
  102e4a:	8b 45 08             	mov    0x8(%ebp),%eax
  102e4d:	8b 50 08             	mov    0x8(%eax),%edx
  102e50:	89 d0                	mov    %edx,%eax
  102e52:	c1 e0 02             	shl    $0x2,%eax
  102e55:	01 d0                	add    %edx,%eax
  102e57:	c1 e0 02             	shl    $0x2,%eax
  102e5a:	89 c2                	mov    %eax,%edx
  102e5c:	8b 45 08             	mov    0x8(%ebp),%eax
  102e5f:	01 d0                	add    %edx,%eax
  102e61:	39 45 f4             	cmp    %eax,-0xc(%ebp)
  102e64:	75 5d                	jne    102ec3 <default_free_pages+0x1c1>
            base->property += p->property;// 合并当前页块
  102e66:	8b 45 08             	mov    0x8(%ebp),%eax
  102e69:	8b 50 08             	mov    0x8(%eax),%edx
  102e6c:	8b 45 f4             	mov    -0xc(%ebp),%eax
  102e6f:	8b 40 08             	mov    0x8(%eax),%eax
  102e72:	01 c2                	add    %eax,%edx
  102e74:	8b 45 08             	mov    0x8(%ebp),%eax
  102e77:	89 50 08             	mov    %edx,0x8(%eax)
            ClearPageProperty(p);// 清除合并页的属性
  102e7a:	8b 45 f4             	mov    -0xc(%ebp),%eax
  102e7d:	83 c0 04             	add    $0x4,%eax
  102e80:	c7 45 b8 01 00 00 00 	movl   $0x1,-0x48(%ebp)
  102e87:	89 45 b4             	mov    %eax,-0x4c(%ebp)
    asm volatile ("btrl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
  102e8a:	8b 45 b4             	mov    -0x4c(%ebp),%eax
  102e8d:	8b 55 b8             	mov    -0x48(%ebp),%edx
  102e90:	0f b3 10             	btr    %edx,(%eax)
}
  102e93:	90                   	nop
            list_del(&(p->page_link));// 从空闲列表中删除合并页
  102e94:	8b 45 f4             	mov    -0xc(%ebp),%eax
  102e97:	83 c0 0c             	add    $0xc,%eax
  102e9a:	89 45 c4             	mov    %eax,-0x3c(%ebp)
    __list_del(listelm->prev, listelm->next);
  102e9d:	8b 45 c4             	mov    -0x3c(%ebp),%eax
  102ea0:	8b 40 04             	mov    0x4(%eax),%eax
  102ea3:	8b 55 c4             	mov    -0x3c(%ebp),%edx
  102ea6:	8b 12                	mov    (%edx),%edx
  102ea8:	89 55 c0             	mov    %edx,-0x40(%ebp)
  102eab:	89 45 bc             	mov    %eax,-0x44(%ebp)
    prev->next = next;
  102eae:	8b 45 c0             	mov    -0x40(%ebp),%eax
  102eb1:	8b 55 bc             	mov    -0x44(%ebp),%edx
  102eb4:	89 50 04             	mov    %edx,0x4(%eax)
    next->prev = prev;
  102eb7:	8b 45 bc             	mov    -0x44(%ebp),%eax
  102eba:	8b 55 c0             	mov    -0x40(%ebp),%edx
  102ebd:	89 10                	mov    %edx,(%eax)
}
  102ebf:	90                   	nop
}
  102ec0:	90                   	nop
  102ec1:	eb 7d                	jmp    102f40 <default_free_pages+0x23e>
        }
        else if (p + p->property == base) {
  102ec3:	8b 45 f4             	mov    -0xc(%ebp),%eax
  102ec6:	8b 50 08             	mov    0x8(%eax),%edx
  102ec9:	89 d0                	mov    %edx,%eax
  102ecb:	c1 e0 02             	shl    $0x2,%eax
  102ece:	01 d0                	add    %edx,%eax
  102ed0:	c1 e0 02             	shl    $0x2,%eax
  102ed3:	89 c2                	mov    %eax,%edx
  102ed5:	8b 45 f4             	mov    -0xc(%ebp),%eax
  102ed8:	01 d0                	add    %edx,%eax
  102eda:	39 45 08             	cmp    %eax,0x8(%ebp)
  102edd:	75 61                	jne    102f40 <default_free_pages+0x23e>
            p->property += base->property;// 合并前一个页块
  102edf:	8b 45 f4             	mov    -0xc(%ebp),%eax
  102ee2:	8b 50 08             	mov    0x8(%eax),%edx
  102ee5:	8b 45 08             	mov    0x8(%ebp),%eax
  102ee8:	8b 40 08             	mov    0x8(%eax),%eax
  102eeb:	01 c2                	add    %eax,%edx
  102eed:	8b 45 f4             	mov    -0xc(%ebp),%eax
  102ef0:	89 50 08             	mov    %edx,0x8(%eax)
            ClearPageProperty(base);// 清除当前页的属性
  102ef3:	8b 45 08             	mov    0x8(%ebp),%eax
  102ef6:	83 c0 04             	add    $0x4,%eax
  102ef9:	c7 45 a4 01 00 00 00 	movl   $0x1,-0x5c(%ebp)
  102f00:	89 45 a0             	mov    %eax,-0x60(%ebp)
    asm volatile ("btrl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
  102f03:	8b 45 a0             	mov    -0x60(%ebp),%eax
  102f06:	8b 55 a4             	mov    -0x5c(%ebp),%edx
  102f09:	0f b3 10             	btr    %edx,(%eax)
}
  102f0c:	90                   	nop
            base = p;// 更新 base 指针
  102f0d:	8b 45 f4             	mov    -0xc(%ebp),%eax
  102f10:	89 45 08             	mov    %eax,0x8(%ebp)
            list_del(&(p->page_link)); // 从空闲列表中删除当前页
  102f13:	8b 45 f4             	mov    -0xc(%ebp),%eax
  102f16:	83 c0 0c             	add    $0xc,%eax
  102f19:	89 45 b0             	mov    %eax,-0x50(%ebp)
    __list_del(listelm->prev, listelm->next);
  102f1c:	8b 45 b0             	mov    -0x50(%ebp),%eax
  102f1f:	8b 40 04             	mov    0x4(%eax),%eax
  102f22:	8b 55 b0             	mov    -0x50(%ebp),%edx
  102f25:	8b 12                	mov    (%edx),%edx
  102f27:	89 55 ac             	mov    %edx,-0x54(%ebp)
  102f2a:	89 45 a8             	mov    %eax,-0x58(%ebp)
    prev->next = next;
  102f2d:	8b 45 ac             	mov    -0x54(%ebp),%eax
  102f30:	8b 55 a8             	mov    -0x58(%ebp),%edx
  102f33:	89 50 04             	mov    %edx,0x4(%eax)
    next->prev = prev;
  102f36:	8b 45 a8             	mov    -0x58(%ebp),%eax
  102f39:	8b 55 ac             	mov    -0x54(%ebp),%edx
  102f3c:	89 10                	mov    %edx,(%eax)
}
  102f3e:	90                   	nop
}
  102f3f:	90                   	nop
    while (le != &free_list) {
  102f40:	81 7d f0 e0 ce 11 00 	cmpl   $0x11cee0,-0x10(%ebp)
  102f47:	0f 85 e5 fe ff ff    	jne    102e32 <default_free_pages+0x130>
        }
    }
    nr_free += n;// 更新空闲页的计数
  102f4d:	8b 15 e8 ce 11 00    	mov    0x11cee8,%edx
  102f53:	8b 45 0c             	mov    0xc(%ebp),%eax
  102f56:	01 d0                	add    %edx,%eax
  102f58:	a3 e8 ce 11 00       	mov    %eax,0x11cee8
  102f5d:	c7 45 9c e0 ce 11 00 	movl   $0x11cee0,-0x64(%ebp)
    return listelm->next;
  102f64:	8b 45 9c             	mov    -0x64(%ebp),%eax
  102f67:	8b 40 04             	mov    0x4(%eax),%eax
    le = list_next(&free_list);
  102f6a:	89 45 f0             	mov    %eax,-0x10(%ebp)
    while (le != &free_list)
  102f6d:	eb 74                	jmp    102fe3 <default_free_pages+0x2e1>
    {
        p = le2page(le, page_link);
  102f6f:	8b 45 f0             	mov    -0x10(%ebp),%eax
  102f72:	83 e8 0c             	sub    $0xc,%eax
  102f75:	89 45 f4             	mov    %eax,-0xc(%ebp)
        if (base + base->property <= p)
  102f78:	8b 45 08             	mov    0x8(%ebp),%eax
  102f7b:	8b 50 08             	mov    0x8(%eax),%edx
  102f7e:	89 d0                	mov    %edx,%eax
  102f80:	c1 e0 02             	shl    $0x2,%eax
  102f83:	01 d0                	add    %edx,%eax
  102f85:	c1 e0 02             	shl    $0x2,%eax
  102f88:	89 c2                	mov    %eax,%edx
  102f8a:	8b 45 08             	mov    0x8(%ebp),%eax
  102f8d:	01 d0                	add    %edx,%eax
  102f8f:	39 45 f4             	cmp    %eax,-0xc(%ebp)
  102f92:	72 40                	jb     102fd4 <default_free_pages+0x2d2>
        {
            assert(base + base->property != p);
  102f94:	8b 45 08             	mov    0x8(%ebp),%eax
  102f97:	8b 50 08             	mov    0x8(%eax),%edx
  102f9a:	89 d0                	mov    %edx,%eax
  102f9c:	c1 e0 02             	shl    $0x2,%eax
  102f9f:	01 d0                	add    %edx,%eax
  102fa1:	c1 e0 02             	shl    $0x2,%eax
  102fa4:	89 c2                	mov    %eax,%edx
  102fa6:	8b 45 08             	mov    0x8(%ebp),%eax
  102fa9:	01 d0                	add    %edx,%eax
  102fab:	39 45 f4             	cmp    %eax,-0xc(%ebp)
  102fae:	75 3e                	jne    102fee <default_free_pages+0x2ec>
  102fb0:	c7 44 24 0c 39 68 10 	movl   $0x106839,0xc(%esp)
  102fb7:	00 
  102fb8:	c7 44 24 08 d6 67 10 	movl   $0x1067d6,0x8(%esp)
  102fbf:	00 
  102fc0:	c7 44 24 04 e9 00 00 	movl   $0xe9,0x4(%esp)
  102fc7:	00 
  102fc8:	c7 04 24 eb 67 10 00 	movl   $0x1067eb,(%esp)
  102fcf:	e8 5f dc ff ff       	call   100c33 <__panic>
  102fd4:	8b 45 f0             	mov    -0x10(%ebp),%eax
  102fd7:	89 45 98             	mov    %eax,-0x68(%ebp)
  102fda:	8b 45 98             	mov    -0x68(%ebp),%eax
  102fdd:	8b 40 04             	mov    0x4(%eax),%eax
            break;
        }
        le = list_next(le);    
  102fe0:	89 45 f0             	mov    %eax,-0x10(%ebp)
    while (le != &free_list)
  102fe3:	81 7d f0 e0 ce 11 00 	cmpl   $0x11cee0,-0x10(%ebp)
  102fea:	75 83                	jne    102f6f <default_free_pages+0x26d>
  102fec:	eb 01                	jmp    102fef <default_free_pages+0x2ed>
            break;
  102fee:	90                   	nop
    }
    
    list_add_before(le, &(base->page_link));// 将释放的页块添加到空闲列表中
  102fef:	8b 45 08             	mov    0x8(%ebp),%eax
  102ff2:	8d 50 0c             	lea    0xc(%eax),%edx
  102ff5:	8b 45 f0             	mov    -0x10(%ebp),%eax
  102ff8:	89 45 94             	mov    %eax,-0x6c(%ebp)
  102ffb:	89 55 90             	mov    %edx,-0x70(%ebp)
    __list_add(elm, listelm->prev, listelm);
  102ffe:	8b 45 94             	mov    -0x6c(%ebp),%eax
  103001:	8b 00                	mov    (%eax),%eax
  103003:	8b 55 90             	mov    -0x70(%ebp),%edx
  103006:	89 55 8c             	mov    %edx,-0x74(%ebp)
  103009:	89 45 88             	mov    %eax,-0x78(%ebp)
  10300c:	8b 45 94             	mov    -0x6c(%ebp),%eax
  10300f:	89 45 84             	mov    %eax,-0x7c(%ebp)
    prev->next = next->prev = elm;
  103012:	8b 45 84             	mov    -0x7c(%ebp),%eax
  103015:	8b 55 8c             	mov    -0x74(%ebp),%edx
  103018:	89 10                	mov    %edx,(%eax)
  10301a:	8b 45 84             	mov    -0x7c(%ebp),%eax
  10301d:	8b 10                	mov    (%eax),%edx
  10301f:	8b 45 88             	mov    -0x78(%ebp),%eax
  103022:	89 50 04             	mov    %edx,0x4(%eax)
    elm->next = next;
  103025:	8b 45 8c             	mov    -0x74(%ebp),%eax
  103028:	8b 55 84             	mov    -0x7c(%ebp),%edx
  10302b:	89 50 04             	mov    %edx,0x4(%eax)
    elm->prev = prev;
  10302e:	8b 45 8c             	mov    -0x74(%ebp),%eax
  103031:	8b 55 88             	mov    -0x78(%ebp),%edx
  103034:	89 10                	mov    %edx,(%eax)
}
  103036:	90                   	nop
}
  103037:	90                   	nop
}
  103038:	90                   	nop
  103039:	89 ec                	mov    %ebp,%esp
  10303b:	5d                   	pop    %ebp
  10303c:	c3                   	ret    

0010303d <default_nr_free_pages>:

//用于返回当前系统中可用的空闲页的数量。
static size_t
default_nr_free_pages(void) {
  10303d:	55                   	push   %ebp
  10303e:	89 e5                	mov    %esp,%ebp
    return nr_free;// 返回当前空闲页的数量
  103040:	a1 e8 ce 11 00       	mov    0x11cee8,%eax
}
  103045:	5d                   	pop    %ebp
  103046:	c3                   	ret    

00103047 <basic_check>:

//basic_check 函数用于测试内存分配和释放的基本功能，
//确保在不同情况下内存管理系统的正确性，包括分配、释放、合并和引用计数等操作。
static void
basic_check(void) {
  103047:	55                   	push   %ebp
  103048:	89 e5                	mov    %esp,%ebp
  10304a:	83 ec 48             	sub    $0x48,%esp
    struct Page *p0, *p1, *p2;
    p0 = p1 = p2 = NULL;
  10304d:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
  103054:	8b 45 f4             	mov    -0xc(%ebp),%eax
  103057:	89 45 f0             	mov    %eax,-0x10(%ebp)
  10305a:	8b 45 f0             	mov    -0x10(%ebp),%eax
  10305d:	89 45 ec             	mov    %eax,-0x14(%ebp)
    // 分配三个页面
    assert((p0 = alloc_page()) != NULL);
  103060:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  103067:	e8 af 0e 00 00       	call   103f1b <alloc_pages>
  10306c:	89 45 ec             	mov    %eax,-0x14(%ebp)
  10306f:	83 7d ec 00          	cmpl   $0x0,-0x14(%ebp)
  103073:	75 24                	jne    103099 <basic_check+0x52>
  103075:	c7 44 24 0c 54 68 10 	movl   $0x106854,0xc(%esp)
  10307c:	00 
  10307d:	c7 44 24 08 d6 67 10 	movl   $0x1067d6,0x8(%esp)
  103084:	00 
  103085:	c7 44 24 04 ff 00 00 	movl   $0xff,0x4(%esp)
  10308c:	00 
  10308d:	c7 04 24 eb 67 10 00 	movl   $0x1067eb,(%esp)
  103094:	e8 9a db ff ff       	call   100c33 <__panic>
    assert((p1 = alloc_page()) != NULL);
  103099:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  1030a0:	e8 76 0e 00 00       	call   103f1b <alloc_pages>
  1030a5:	89 45 f0             	mov    %eax,-0x10(%ebp)
  1030a8:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
  1030ac:	75 24                	jne    1030d2 <basic_check+0x8b>
  1030ae:	c7 44 24 0c 70 68 10 	movl   $0x106870,0xc(%esp)
  1030b5:	00 
  1030b6:	c7 44 24 08 d6 67 10 	movl   $0x1067d6,0x8(%esp)
  1030bd:	00 
  1030be:	c7 44 24 04 00 01 00 	movl   $0x100,0x4(%esp)
  1030c5:	00 
  1030c6:	c7 04 24 eb 67 10 00 	movl   $0x1067eb,(%esp)
  1030cd:	e8 61 db ff ff       	call   100c33 <__panic>
    assert((p2 = alloc_page()) != NULL);
  1030d2:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  1030d9:	e8 3d 0e 00 00       	call   103f1b <alloc_pages>
  1030de:	89 45 f4             	mov    %eax,-0xc(%ebp)
  1030e1:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
  1030e5:	75 24                	jne    10310b <basic_check+0xc4>
  1030e7:	c7 44 24 0c 8c 68 10 	movl   $0x10688c,0xc(%esp)
  1030ee:	00 
  1030ef:	c7 44 24 08 d6 67 10 	movl   $0x1067d6,0x8(%esp)
  1030f6:	00 
  1030f7:	c7 44 24 04 01 01 00 	movl   $0x101,0x4(%esp)
  1030fe:	00 
  1030ff:	c7 04 24 eb 67 10 00 	movl   $0x1067eb,(%esp)
  103106:	e8 28 db ff ff       	call   100c33 <__panic>
    // 确保所有分配的页面是不同的
    assert(p0 != p1 && p0 != p2 && p1 != p2);
  10310b:	8b 45 ec             	mov    -0x14(%ebp),%eax
  10310e:	3b 45 f0             	cmp    -0x10(%ebp),%eax
  103111:	74 10                	je     103123 <basic_check+0xdc>
  103113:	8b 45 ec             	mov    -0x14(%ebp),%eax
  103116:	3b 45 f4             	cmp    -0xc(%ebp),%eax
  103119:	74 08                	je     103123 <basic_check+0xdc>
  10311b:	8b 45 f0             	mov    -0x10(%ebp),%eax
  10311e:	3b 45 f4             	cmp    -0xc(%ebp),%eax
  103121:	75 24                	jne    103147 <basic_check+0x100>
  103123:	c7 44 24 0c a8 68 10 	movl   $0x1068a8,0xc(%esp)
  10312a:	00 
  10312b:	c7 44 24 08 d6 67 10 	movl   $0x1067d6,0x8(%esp)
  103132:	00 
  103133:	c7 44 24 04 03 01 00 	movl   $0x103,0x4(%esp)
  10313a:	00 
  10313b:	c7 04 24 eb 67 10 00 	movl   $0x1067eb,(%esp)
  103142:	e8 ec da ff ff       	call   100c33 <__panic>
    // 确保页面的引用计数为 0
    assert(page_ref(p0) == 0 && page_ref(p1) == 0 && page_ref(p2) == 0);
  103147:	8b 45 ec             	mov    -0x14(%ebp),%eax
  10314a:	89 04 24             	mov    %eax,(%esp)
  10314d:	e8 88 f8 ff ff       	call   1029da <page_ref>
  103152:	85 c0                	test   %eax,%eax
  103154:	75 1e                	jne    103174 <basic_check+0x12d>
  103156:	8b 45 f0             	mov    -0x10(%ebp),%eax
  103159:	89 04 24             	mov    %eax,(%esp)
  10315c:	e8 79 f8 ff ff       	call   1029da <page_ref>
  103161:	85 c0                	test   %eax,%eax
  103163:	75 0f                	jne    103174 <basic_check+0x12d>
  103165:	8b 45 f4             	mov    -0xc(%ebp),%eax
  103168:	89 04 24             	mov    %eax,(%esp)
  10316b:	e8 6a f8 ff ff       	call   1029da <page_ref>
  103170:	85 c0                	test   %eax,%eax
  103172:	74 24                	je     103198 <basic_check+0x151>
  103174:	c7 44 24 0c cc 68 10 	movl   $0x1068cc,0xc(%esp)
  10317b:	00 
  10317c:	c7 44 24 08 d6 67 10 	movl   $0x1067d6,0x8(%esp)
  103183:	00 
  103184:	c7 44 24 04 05 01 00 	movl   $0x105,0x4(%esp)
  10318b:	00 
  10318c:	c7 04 24 eb 67 10 00 	movl   $0x1067eb,(%esp)
  103193:	e8 9b da ff ff       	call   100c33 <__panic>
    // 确保页面地址在合法范围内
    assert(page2pa(p0) < npage * PGSIZE);
  103198:	8b 45 ec             	mov    -0x14(%ebp),%eax
  10319b:	89 04 24             	mov    %eax,(%esp)
  10319e:	e8 1f f8 ff ff       	call   1029c2 <page2pa>
  1031a3:	8b 15 04 cf 11 00    	mov    0x11cf04,%edx
  1031a9:	c1 e2 0c             	shl    $0xc,%edx
  1031ac:	39 d0                	cmp    %edx,%eax
  1031ae:	72 24                	jb     1031d4 <basic_check+0x18d>
  1031b0:	c7 44 24 0c 08 69 10 	movl   $0x106908,0xc(%esp)
  1031b7:	00 
  1031b8:	c7 44 24 08 d6 67 10 	movl   $0x1067d6,0x8(%esp)
  1031bf:	00 
  1031c0:	c7 44 24 04 07 01 00 	movl   $0x107,0x4(%esp)
  1031c7:	00 
  1031c8:	c7 04 24 eb 67 10 00 	movl   $0x1067eb,(%esp)
  1031cf:	e8 5f da ff ff       	call   100c33 <__panic>
    assert(page2pa(p1) < npage * PGSIZE);
  1031d4:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1031d7:	89 04 24             	mov    %eax,(%esp)
  1031da:	e8 e3 f7 ff ff       	call   1029c2 <page2pa>
  1031df:	8b 15 04 cf 11 00    	mov    0x11cf04,%edx
  1031e5:	c1 e2 0c             	shl    $0xc,%edx
  1031e8:	39 d0                	cmp    %edx,%eax
  1031ea:	72 24                	jb     103210 <basic_check+0x1c9>
  1031ec:	c7 44 24 0c 25 69 10 	movl   $0x106925,0xc(%esp)
  1031f3:	00 
  1031f4:	c7 44 24 08 d6 67 10 	movl   $0x1067d6,0x8(%esp)
  1031fb:	00 
  1031fc:	c7 44 24 04 08 01 00 	movl   $0x108,0x4(%esp)
  103203:	00 
  103204:	c7 04 24 eb 67 10 00 	movl   $0x1067eb,(%esp)
  10320b:	e8 23 da ff ff       	call   100c33 <__panic>
    assert(page2pa(p2) < npage * PGSIZE);
  103210:	8b 45 f4             	mov    -0xc(%ebp),%eax
  103213:	89 04 24             	mov    %eax,(%esp)
  103216:	e8 a7 f7 ff ff       	call   1029c2 <page2pa>
  10321b:	8b 15 04 cf 11 00    	mov    0x11cf04,%edx
  103221:	c1 e2 0c             	shl    $0xc,%edx
  103224:	39 d0                	cmp    %edx,%eax
  103226:	72 24                	jb     10324c <basic_check+0x205>
  103228:	c7 44 24 0c 42 69 10 	movl   $0x106942,0xc(%esp)
  10322f:	00 
  103230:	c7 44 24 08 d6 67 10 	movl   $0x1067d6,0x8(%esp)
  103237:	00 
  103238:	c7 44 24 04 09 01 00 	movl   $0x109,0x4(%esp)
  10323f:	00 
  103240:	c7 04 24 eb 67 10 00 	movl   $0x1067eb,(%esp)
  103247:	e8 e7 d9 ff ff       	call   100c33 <__panic>
    // 保存当前的空闲页面链表和数量
    list_entry_t free_list_store = free_list;
  10324c:	a1 e0 ce 11 00       	mov    0x11cee0,%eax
  103251:	8b 15 e4 ce 11 00    	mov    0x11cee4,%edx
  103257:	89 45 d0             	mov    %eax,-0x30(%ebp)
  10325a:	89 55 d4             	mov    %edx,-0x2c(%ebp)
  10325d:	c7 45 dc e0 ce 11 00 	movl   $0x11cee0,-0x24(%ebp)
    elm->prev = elm->next = elm;
  103264:	8b 45 dc             	mov    -0x24(%ebp),%eax
  103267:	8b 55 dc             	mov    -0x24(%ebp),%edx
  10326a:	89 50 04             	mov    %edx,0x4(%eax)
  10326d:	8b 45 dc             	mov    -0x24(%ebp),%eax
  103270:	8b 50 04             	mov    0x4(%eax),%edx
  103273:	8b 45 dc             	mov    -0x24(%ebp),%eax
  103276:	89 10                	mov    %edx,(%eax)
}
  103278:	90                   	nop
  103279:	c7 45 e0 e0 ce 11 00 	movl   $0x11cee0,-0x20(%ebp)
    return list->next == list;
  103280:	8b 45 e0             	mov    -0x20(%ebp),%eax
  103283:	8b 40 04             	mov    0x4(%eax),%eax
  103286:	39 45 e0             	cmp    %eax,-0x20(%ebp)
  103289:	0f 94 c0             	sete   %al
  10328c:	0f b6 c0             	movzbl %al,%eax
    list_init(&free_list);// 初始化空闲列表
    assert(list_empty(&free_list));// 确保空闲列表为空
  10328f:	85 c0                	test   %eax,%eax
  103291:	75 24                	jne    1032b7 <basic_check+0x270>
  103293:	c7 44 24 0c 5f 69 10 	movl   $0x10695f,0xc(%esp)
  10329a:	00 
  10329b:	c7 44 24 08 d6 67 10 	movl   $0x1067d6,0x8(%esp)
  1032a2:	00 
  1032a3:	c7 44 24 04 0d 01 00 	movl   $0x10d,0x4(%esp)
  1032aa:	00 
  1032ab:	c7 04 24 eb 67 10 00 	movl   $0x1067eb,(%esp)
  1032b2:	e8 7c d9 ff ff       	call   100c33 <__panic>

    unsigned int nr_free_store = nr_free;// 保存当前空闲页数量
  1032b7:	a1 e8 ce 11 00       	mov    0x11cee8,%eax
  1032bc:	89 45 e8             	mov    %eax,-0x18(%ebp)
    nr_free = 0;// 将空闲页数量设为 0
  1032bf:	c7 05 e8 ce 11 00 00 	movl   $0x0,0x11cee8
  1032c6:	00 00 00 
    // 请求分配页面，但当前没有空闲页面
    assert(alloc_page() == NULL);
  1032c9:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  1032d0:	e8 46 0c 00 00       	call   103f1b <alloc_pages>
  1032d5:	85 c0                	test   %eax,%eax
  1032d7:	74 24                	je     1032fd <basic_check+0x2b6>
  1032d9:	c7 44 24 0c 76 69 10 	movl   $0x106976,0xc(%esp)
  1032e0:	00 
  1032e1:	c7 44 24 08 d6 67 10 	movl   $0x1067d6,0x8(%esp)
  1032e8:	00 
  1032e9:	c7 44 24 04 12 01 00 	movl   $0x112,0x4(%esp)
  1032f0:	00 
  1032f1:	c7 04 24 eb 67 10 00 	movl   $0x1067eb,(%esp)
  1032f8:	e8 36 d9 ff ff       	call   100c33 <__panic>
    // 释放之前分配的页面
    free_page(p0);
  1032fd:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  103304:	00 
  103305:	8b 45 ec             	mov    -0x14(%ebp),%eax
  103308:	89 04 24             	mov    %eax,(%esp)
  10330b:	e8 45 0c 00 00       	call   103f55 <free_pages>
    free_page(p1);
  103310:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  103317:	00 
  103318:	8b 45 f0             	mov    -0x10(%ebp),%eax
  10331b:	89 04 24             	mov    %eax,(%esp)
  10331e:	e8 32 0c 00 00       	call   103f55 <free_pages>
    free_page(p2);
  103323:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  10332a:	00 
  10332b:	8b 45 f4             	mov    -0xc(%ebp),%eax
  10332e:	89 04 24             	mov    %eax,(%esp)
  103331:	e8 1f 0c 00 00       	call   103f55 <free_pages>
    assert(nr_free == 3);// 确保释放后空闲页数量为 3
  103336:	a1 e8 ce 11 00       	mov    0x11cee8,%eax
  10333b:	83 f8 03             	cmp    $0x3,%eax
  10333e:	74 24                	je     103364 <basic_check+0x31d>
  103340:	c7 44 24 0c 8b 69 10 	movl   $0x10698b,0xc(%esp)
  103347:	00 
  103348:	c7 44 24 08 d6 67 10 	movl   $0x1067d6,0x8(%esp)
  10334f:	00 
  103350:	c7 44 24 04 17 01 00 	movl   $0x117,0x4(%esp)
  103357:	00 
  103358:	c7 04 24 eb 67 10 00 	movl   $0x1067eb,(%esp)
  10335f:	e8 cf d8 ff ff       	call   100c33 <__panic>
    // 再次分配三个页面
    assert((p0 = alloc_page()) != NULL);
  103364:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  10336b:	e8 ab 0b 00 00       	call   103f1b <alloc_pages>
  103370:	89 45 ec             	mov    %eax,-0x14(%ebp)
  103373:	83 7d ec 00          	cmpl   $0x0,-0x14(%ebp)
  103377:	75 24                	jne    10339d <basic_check+0x356>
  103379:	c7 44 24 0c 54 68 10 	movl   $0x106854,0xc(%esp)
  103380:	00 
  103381:	c7 44 24 08 d6 67 10 	movl   $0x1067d6,0x8(%esp)
  103388:	00 
  103389:	c7 44 24 04 19 01 00 	movl   $0x119,0x4(%esp)
  103390:	00 
  103391:	c7 04 24 eb 67 10 00 	movl   $0x1067eb,(%esp)
  103398:	e8 96 d8 ff ff       	call   100c33 <__panic>
    assert((p1 = alloc_page()) != NULL);
  10339d:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  1033a4:	e8 72 0b 00 00       	call   103f1b <alloc_pages>
  1033a9:	89 45 f0             	mov    %eax,-0x10(%ebp)
  1033ac:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
  1033b0:	75 24                	jne    1033d6 <basic_check+0x38f>
  1033b2:	c7 44 24 0c 70 68 10 	movl   $0x106870,0xc(%esp)
  1033b9:	00 
  1033ba:	c7 44 24 08 d6 67 10 	movl   $0x1067d6,0x8(%esp)
  1033c1:	00 
  1033c2:	c7 44 24 04 1a 01 00 	movl   $0x11a,0x4(%esp)
  1033c9:	00 
  1033ca:	c7 04 24 eb 67 10 00 	movl   $0x1067eb,(%esp)
  1033d1:	e8 5d d8 ff ff       	call   100c33 <__panic>
    assert((p2 = alloc_page()) != NULL);
  1033d6:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  1033dd:	e8 39 0b 00 00       	call   103f1b <alloc_pages>
  1033e2:	89 45 f4             	mov    %eax,-0xc(%ebp)
  1033e5:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
  1033e9:	75 24                	jne    10340f <basic_check+0x3c8>
  1033eb:	c7 44 24 0c 8c 68 10 	movl   $0x10688c,0xc(%esp)
  1033f2:	00 
  1033f3:	c7 44 24 08 d6 67 10 	movl   $0x1067d6,0x8(%esp)
  1033fa:	00 
  1033fb:	c7 44 24 04 1b 01 00 	movl   $0x11b,0x4(%esp)
  103402:	00 
  103403:	c7 04 24 eb 67 10 00 	movl   $0x1067eb,(%esp)
  10340a:	e8 24 d8 ff ff       	call   100c33 <__panic>
// 测试空闲页面是否不足
    assert(alloc_page() == NULL);
  10340f:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  103416:	e8 00 0b 00 00       	call   103f1b <alloc_pages>
  10341b:	85 c0                	test   %eax,%eax
  10341d:	74 24                	je     103443 <basic_check+0x3fc>
  10341f:	c7 44 24 0c 76 69 10 	movl   $0x106976,0xc(%esp)
  103426:	00 
  103427:	c7 44 24 08 d6 67 10 	movl   $0x1067d6,0x8(%esp)
  10342e:	00 
  10342f:	c7 44 24 04 1d 01 00 	movl   $0x11d,0x4(%esp)
  103436:	00 
  103437:	c7 04 24 eb 67 10 00 	movl   $0x1067eb,(%esp)
  10343e:	e8 f0 d7 ff ff       	call   100c33 <__panic>
// 释放 p0，并检查空闲列表
    free_page(p0);
  103443:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  10344a:	00 
  10344b:	8b 45 ec             	mov    -0x14(%ebp),%eax
  10344e:	89 04 24             	mov    %eax,(%esp)
  103451:	e8 ff 0a 00 00       	call   103f55 <free_pages>
  103456:	c7 45 d8 e0 ce 11 00 	movl   $0x11cee0,-0x28(%ebp)
  10345d:	8b 45 d8             	mov    -0x28(%ebp),%eax
  103460:	8b 40 04             	mov    0x4(%eax),%eax
  103463:	39 45 d8             	cmp    %eax,-0x28(%ebp)
  103466:	0f 94 c0             	sete   %al
  103469:	0f b6 c0             	movzbl %al,%eax
    assert(!list_empty(&free_list));// 确保空闲列表不为空
  10346c:	85 c0                	test   %eax,%eax
  10346e:	74 24                	je     103494 <basic_check+0x44d>
  103470:	c7 44 24 0c 98 69 10 	movl   $0x106998,0xc(%esp)
  103477:	00 
  103478:	c7 44 24 08 d6 67 10 	movl   $0x1067d6,0x8(%esp)
  10347f:	00 
  103480:	c7 44 24 04 20 01 00 	movl   $0x120,0x4(%esp)
  103487:	00 
  103488:	c7 04 24 eb 67 10 00 	movl   $0x1067eb,(%esp)
  10348f:	e8 9f d7 ff ff       	call   100c33 <__panic>

    struct Page *p;
    // 重新分配 p0，确保取回的是相同的页面
    assert((p = alloc_page()) == p0);
  103494:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  10349b:	e8 7b 0a 00 00       	call   103f1b <alloc_pages>
  1034a0:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  1034a3:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  1034a6:	3b 45 ec             	cmp    -0x14(%ebp),%eax
  1034a9:	74 24                	je     1034cf <basic_check+0x488>
  1034ab:	c7 44 24 0c b0 69 10 	movl   $0x1069b0,0xc(%esp)
  1034b2:	00 
  1034b3:	c7 44 24 08 d6 67 10 	movl   $0x1067d6,0x8(%esp)
  1034ba:	00 
  1034bb:	c7 44 24 04 24 01 00 	movl   $0x124,0x4(%esp)
  1034c2:	00 
  1034c3:	c7 04 24 eb 67 10 00 	movl   $0x1067eb,(%esp)
  1034ca:	e8 64 d7 ff ff       	call   100c33 <__panic>
    assert(alloc_page() == NULL); // 确保没有更多的页面可分配
  1034cf:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  1034d6:	e8 40 0a 00 00       	call   103f1b <alloc_pages>
  1034db:	85 c0                	test   %eax,%eax
  1034dd:	74 24                	je     103503 <basic_check+0x4bc>
  1034df:	c7 44 24 0c 76 69 10 	movl   $0x106976,0xc(%esp)
  1034e6:	00 
  1034e7:	c7 44 24 08 d6 67 10 	movl   $0x1067d6,0x8(%esp)
  1034ee:	00 
  1034ef:	c7 44 24 04 25 01 00 	movl   $0x125,0x4(%esp)
  1034f6:	00 
  1034f7:	c7 04 24 eb 67 10 00 	movl   $0x1067eb,(%esp)
  1034fe:	e8 30 d7 ff ff       	call   100c33 <__panic>

    assert(nr_free == 0);// 确保当前空闲页面数量为 0
  103503:	a1 e8 ce 11 00       	mov    0x11cee8,%eax
  103508:	85 c0                	test   %eax,%eax
  10350a:	74 24                	je     103530 <basic_check+0x4e9>
  10350c:	c7 44 24 0c c9 69 10 	movl   $0x1069c9,0xc(%esp)
  103513:	00 
  103514:	c7 44 24 08 d6 67 10 	movl   $0x1067d6,0x8(%esp)
  10351b:	00 
  10351c:	c7 44 24 04 27 01 00 	movl   $0x127,0x4(%esp)
  103523:	00 
  103524:	c7 04 24 eb 67 10 00 	movl   $0x1067eb,(%esp)
  10352b:	e8 03 d7 ff ff       	call   100c33 <__panic>
    // 恢复之前的空闲页面链表和数量
    free_list = free_list_store;
  103530:	8b 45 d0             	mov    -0x30(%ebp),%eax
  103533:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  103536:	a3 e0 ce 11 00       	mov    %eax,0x11cee0
  10353b:	89 15 e4 ce 11 00    	mov    %edx,0x11cee4
    nr_free = nr_free_store;
  103541:	8b 45 e8             	mov    -0x18(%ebp),%eax
  103544:	a3 e8 ce 11 00       	mov    %eax,0x11cee8
 // 释放最后的页面
    free_page(p);
  103549:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  103550:	00 
  103551:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  103554:	89 04 24             	mov    %eax,(%esp)
  103557:	e8 f9 09 00 00       	call   103f55 <free_pages>
    free_page(p1);
  10355c:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  103563:	00 
  103564:	8b 45 f0             	mov    -0x10(%ebp),%eax
  103567:	89 04 24             	mov    %eax,(%esp)
  10356a:	e8 e6 09 00 00       	call   103f55 <free_pages>
    free_page(p2);
  10356f:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  103576:	00 
  103577:	8b 45 f4             	mov    -0xc(%ebp),%eax
  10357a:	89 04 24             	mov    %eax,(%esp)
  10357d:	e8 d3 09 00 00       	call   103f55 <free_pages>
}
  103582:	90                   	nop
  103583:	89 ec                	mov    %ebp,%esp
  103585:	5d                   	pop    %ebp
  103586:	c3                   	ret    

00103587 <default_check>:

// LAB2: below code is used to check the first fit allocation algorithm (your EXERCISE 1) 
// NOTICE: You SHOULD NOT CHANGE basic_check, default_check functions!
static void
default_check(void) {
  103587:	55                   	push   %ebp
  103588:	89 e5                	mov    %esp,%ebp
  10358a:	81 ec 98 00 00 00    	sub    $0x98,%esp
    int count = 0, total = 0;
  103590:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
  103597:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
    list_entry_t *le = &free_list;
  10359e:	c7 45 ec e0 ce 11 00 	movl   $0x11cee0,-0x14(%ebp)
    // 遍历空闲列表，计算空闲页面的数量和总属性值
    while ((le = list_next(le)) != &free_list) {
  1035a5:	eb 6a                	jmp    103611 <default_check+0x8a>
        struct Page *p = le2page(le, page_link);
  1035a7:	8b 45 ec             	mov    -0x14(%ebp),%eax
  1035aa:	83 e8 0c             	sub    $0xc,%eax
  1035ad:	89 45 d4             	mov    %eax,-0x2c(%ebp)
        assert(PageProperty(p));// 确保每个页面的属性是有效的
  1035b0:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  1035b3:	83 c0 04             	add    $0x4,%eax
  1035b6:	c7 45 d0 01 00 00 00 	movl   $0x1,-0x30(%ebp)
  1035bd:	89 45 cc             	mov    %eax,-0x34(%ebp)
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
  1035c0:	8b 45 cc             	mov    -0x34(%ebp),%eax
  1035c3:	8b 55 d0             	mov    -0x30(%ebp),%edx
  1035c6:	0f a3 10             	bt     %edx,(%eax)
  1035c9:	19 c0                	sbb    %eax,%eax
  1035cb:	89 45 c8             	mov    %eax,-0x38(%ebp)
    return oldbit != 0;
  1035ce:	83 7d c8 00          	cmpl   $0x0,-0x38(%ebp)
  1035d2:	0f 95 c0             	setne  %al
  1035d5:	0f b6 c0             	movzbl %al,%eax
  1035d8:	85 c0                	test   %eax,%eax
  1035da:	75 24                	jne    103600 <default_check+0x79>
  1035dc:	c7 44 24 0c d6 69 10 	movl   $0x1069d6,0xc(%esp)
  1035e3:	00 
  1035e4:	c7 44 24 08 d6 67 10 	movl   $0x1067d6,0x8(%esp)
  1035eb:	00 
  1035ec:	c7 44 24 04 3a 01 00 	movl   $0x13a,0x4(%esp)
  1035f3:	00 
  1035f4:	c7 04 24 eb 67 10 00 	movl   $0x1067eb,(%esp)
  1035fb:	e8 33 d6 ff ff       	call   100c33 <__panic>
        count ++, total += p->property;// 累加页面属性
  103600:	ff 45 f4             	incl   -0xc(%ebp)
  103603:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  103606:	8b 50 08             	mov    0x8(%eax),%edx
  103609:	8b 45 f0             	mov    -0x10(%ebp),%eax
  10360c:	01 d0                	add    %edx,%eax
  10360e:	89 45 f0             	mov    %eax,-0x10(%ebp)
  103611:	8b 45 ec             	mov    -0x14(%ebp),%eax
  103614:	89 45 c4             	mov    %eax,-0x3c(%ebp)
    return listelm->next;
  103617:	8b 45 c4             	mov    -0x3c(%ebp),%eax
  10361a:	8b 40 04             	mov    0x4(%eax),%eax
    while ((le = list_next(le)) != &free_list) {
  10361d:	89 45 ec             	mov    %eax,-0x14(%ebp)
  103620:	81 7d ec e0 ce 11 00 	cmpl   $0x11cee0,-0x14(%ebp)
  103627:	0f 85 7a ff ff ff    	jne    1035a7 <default_check+0x20>
    }
    // 确保总属性值与空闲页面数量匹配
    assert(total == nr_free_pages());
  10362d:	e8 58 09 00 00       	call   103f8a <nr_free_pages>
  103632:	8b 55 f0             	mov    -0x10(%ebp),%edx
  103635:	39 d0                	cmp    %edx,%eax
  103637:	74 24                	je     10365d <default_check+0xd6>
  103639:	c7 44 24 0c e6 69 10 	movl   $0x1069e6,0xc(%esp)
  103640:	00 
  103641:	c7 44 24 08 d6 67 10 	movl   $0x1067d6,0x8(%esp)
  103648:	00 
  103649:	c7 44 24 04 3e 01 00 	movl   $0x13e,0x4(%esp)
  103650:	00 
  103651:	c7 04 24 eb 67 10 00 	movl   $0x1067eb,(%esp)
  103658:	e8 d6 d5 ff ff       	call   100c33 <__panic>
    // 调用 basic_check 以验证基本的内存管理功能
    basic_check();
  10365d:	e8 e5 f9 ff ff       	call   103047 <basic_check>
    // 分配 5 个页面
    struct Page *p0 = alloc_pages(5), *p1, *p2;
  103662:	c7 04 24 05 00 00 00 	movl   $0x5,(%esp)
  103669:	e8 ad 08 00 00       	call   103f1b <alloc_pages>
  10366e:	89 45 e8             	mov    %eax,-0x18(%ebp)
    assert(p0 != NULL);// 确保成功分配
  103671:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
  103675:	75 24                	jne    10369b <default_check+0x114>
  103677:	c7 44 24 0c ff 69 10 	movl   $0x1069ff,0xc(%esp)
  10367e:	00 
  10367f:	c7 44 24 08 d6 67 10 	movl   $0x1067d6,0x8(%esp)
  103686:	00 
  103687:	c7 44 24 04 43 01 00 	movl   $0x143,0x4(%esp)
  10368e:	00 
  10368f:	c7 04 24 eb 67 10 00 	movl   $0x1067eb,(%esp)
  103696:	e8 98 d5 ff ff       	call   100c33 <__panic>
    assert(!PageProperty(p0));// 确保分配的页面不带属性
  10369b:	8b 45 e8             	mov    -0x18(%ebp),%eax
  10369e:	83 c0 04             	add    $0x4,%eax
  1036a1:	c7 45 c0 01 00 00 00 	movl   $0x1,-0x40(%ebp)
  1036a8:	89 45 bc             	mov    %eax,-0x44(%ebp)
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
  1036ab:	8b 45 bc             	mov    -0x44(%ebp),%eax
  1036ae:	8b 55 c0             	mov    -0x40(%ebp),%edx
  1036b1:	0f a3 10             	bt     %edx,(%eax)
  1036b4:	19 c0                	sbb    %eax,%eax
  1036b6:	89 45 b8             	mov    %eax,-0x48(%ebp)
    return oldbit != 0;
  1036b9:	83 7d b8 00          	cmpl   $0x0,-0x48(%ebp)
  1036bd:	0f 95 c0             	setne  %al
  1036c0:	0f b6 c0             	movzbl %al,%eax
  1036c3:	85 c0                	test   %eax,%eax
  1036c5:	74 24                	je     1036eb <default_check+0x164>
  1036c7:	c7 44 24 0c 0a 6a 10 	movl   $0x106a0a,0xc(%esp)
  1036ce:	00 
  1036cf:	c7 44 24 08 d6 67 10 	movl   $0x1067d6,0x8(%esp)
  1036d6:	00 
  1036d7:	c7 44 24 04 44 01 00 	movl   $0x144,0x4(%esp)
  1036de:	00 
  1036df:	c7 04 24 eb 67 10 00 	movl   $0x1067eb,(%esp)
  1036e6:	e8 48 d5 ff ff       	call   100c33 <__panic>
     // 初始化并检查空闲列表
    list_entry_t free_list_store = free_list;
  1036eb:	a1 e0 ce 11 00       	mov    0x11cee0,%eax
  1036f0:	8b 15 e4 ce 11 00    	mov    0x11cee4,%edx
  1036f6:	89 45 80             	mov    %eax,-0x80(%ebp)
  1036f9:	89 55 84             	mov    %edx,-0x7c(%ebp)
  1036fc:	c7 45 b0 e0 ce 11 00 	movl   $0x11cee0,-0x50(%ebp)
    elm->prev = elm->next = elm;
  103703:	8b 45 b0             	mov    -0x50(%ebp),%eax
  103706:	8b 55 b0             	mov    -0x50(%ebp),%edx
  103709:	89 50 04             	mov    %edx,0x4(%eax)
  10370c:	8b 45 b0             	mov    -0x50(%ebp),%eax
  10370f:	8b 50 04             	mov    0x4(%eax),%edx
  103712:	8b 45 b0             	mov    -0x50(%ebp),%eax
  103715:	89 10                	mov    %edx,(%eax)
}
  103717:	90                   	nop
  103718:	c7 45 b4 e0 ce 11 00 	movl   $0x11cee0,-0x4c(%ebp)
    return list->next == list;
  10371f:	8b 45 b4             	mov    -0x4c(%ebp),%eax
  103722:	8b 40 04             	mov    0x4(%eax),%eax
  103725:	39 45 b4             	cmp    %eax,-0x4c(%ebp)
  103728:	0f 94 c0             	sete   %al
  10372b:	0f b6 c0             	movzbl %al,%eax
    list_init(&free_list);
    assert(list_empty(&free_list));// 确保空闲列表为空
  10372e:	85 c0                	test   %eax,%eax
  103730:	75 24                	jne    103756 <default_check+0x1cf>
  103732:	c7 44 24 0c 5f 69 10 	movl   $0x10695f,0xc(%esp)
  103739:	00 
  10373a:	c7 44 24 08 d6 67 10 	movl   $0x1067d6,0x8(%esp)
  103741:	00 
  103742:	c7 44 24 04 48 01 00 	movl   $0x148,0x4(%esp)
  103749:	00 
  10374a:	c7 04 24 eb 67 10 00 	movl   $0x1067eb,(%esp)
  103751:	e8 dd d4 ff ff       	call   100c33 <__panic>
    assert(alloc_page() == NULL);// 确保没有页面可分配
  103756:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  10375d:	e8 b9 07 00 00       	call   103f1b <alloc_pages>
  103762:	85 c0                	test   %eax,%eax
  103764:	74 24                	je     10378a <default_check+0x203>
  103766:	c7 44 24 0c 76 69 10 	movl   $0x106976,0xc(%esp)
  10376d:	00 
  10376e:	c7 44 24 08 d6 67 10 	movl   $0x1067d6,0x8(%esp)
  103775:	00 
  103776:	c7 44 24 04 49 01 00 	movl   $0x149,0x4(%esp)
  10377d:	00 
  10377e:	c7 04 24 eb 67 10 00 	movl   $0x1067eb,(%esp)
  103785:	e8 a9 d4 ff ff       	call   100c33 <__panic>

    unsigned int nr_free_store = nr_free;// 保存当前空闲页数
  10378a:	a1 e8 ce 11 00       	mov    0x11cee8,%eax
  10378f:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    nr_free = 0;// 将空闲页数设为 0
  103792:	c7 05 e8 ce 11 00 00 	movl   $0x0,0x11cee8
  103799:	00 00 00 
// 释放 3 个页面并确保分配页面时没有足够的空闲页
    free_pages(p0 + 2, 3);
  10379c:	8b 45 e8             	mov    -0x18(%ebp),%eax
  10379f:	83 c0 28             	add    $0x28,%eax
  1037a2:	c7 44 24 04 03 00 00 	movl   $0x3,0x4(%esp)
  1037a9:	00 
  1037aa:	89 04 24             	mov    %eax,(%esp)
  1037ad:	e8 a3 07 00 00       	call   103f55 <free_pages>
    assert(alloc_pages(4) == NULL);// 确保无法分配 4 个页面
  1037b2:	c7 04 24 04 00 00 00 	movl   $0x4,(%esp)
  1037b9:	e8 5d 07 00 00       	call   103f1b <alloc_pages>
  1037be:	85 c0                	test   %eax,%eax
  1037c0:	74 24                	je     1037e6 <default_check+0x25f>
  1037c2:	c7 44 24 0c 1c 6a 10 	movl   $0x106a1c,0xc(%esp)
  1037c9:	00 
  1037ca:	c7 44 24 08 d6 67 10 	movl   $0x1067d6,0x8(%esp)
  1037d1:	00 
  1037d2:	c7 44 24 04 4f 01 00 	movl   $0x14f,0x4(%esp)
  1037d9:	00 
  1037da:	c7 04 24 eb 67 10 00 	movl   $0x1067eb,(%esp)
  1037e1:	e8 4d d4 ff ff       	call   100c33 <__panic>
    assert(PageProperty(p0 + 2) && p0[2].property == 3);// 检查页面属性
  1037e6:	8b 45 e8             	mov    -0x18(%ebp),%eax
  1037e9:	83 c0 28             	add    $0x28,%eax
  1037ec:	83 c0 04             	add    $0x4,%eax
  1037ef:	c7 45 ac 01 00 00 00 	movl   $0x1,-0x54(%ebp)
  1037f6:	89 45 a8             	mov    %eax,-0x58(%ebp)
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
  1037f9:	8b 45 a8             	mov    -0x58(%ebp),%eax
  1037fc:	8b 55 ac             	mov    -0x54(%ebp),%edx
  1037ff:	0f a3 10             	bt     %edx,(%eax)
  103802:	19 c0                	sbb    %eax,%eax
  103804:	89 45 a4             	mov    %eax,-0x5c(%ebp)
    return oldbit != 0;
  103807:	83 7d a4 00          	cmpl   $0x0,-0x5c(%ebp)
  10380b:	0f 95 c0             	setne  %al
  10380e:	0f b6 c0             	movzbl %al,%eax
  103811:	85 c0                	test   %eax,%eax
  103813:	74 0e                	je     103823 <default_check+0x29c>
  103815:	8b 45 e8             	mov    -0x18(%ebp),%eax
  103818:	83 c0 28             	add    $0x28,%eax
  10381b:	8b 40 08             	mov    0x8(%eax),%eax
  10381e:	83 f8 03             	cmp    $0x3,%eax
  103821:	74 24                	je     103847 <default_check+0x2c0>
  103823:	c7 44 24 0c 34 6a 10 	movl   $0x106a34,0xc(%esp)
  10382a:	00 
  10382b:	c7 44 24 08 d6 67 10 	movl   $0x1067d6,0x8(%esp)
  103832:	00 
  103833:	c7 44 24 04 50 01 00 	movl   $0x150,0x4(%esp)
  10383a:	00 
  10383b:	c7 04 24 eb 67 10 00 	movl   $0x1067eb,(%esp)
  103842:	e8 ec d3 ff ff       	call   100c33 <__panic>
    assert((p1 = alloc_pages(3)) != NULL);// 再次分配 3 个页面
  103847:	c7 04 24 03 00 00 00 	movl   $0x3,(%esp)
  10384e:	e8 c8 06 00 00       	call   103f1b <alloc_pages>
  103853:	89 45 e0             	mov    %eax,-0x20(%ebp)
  103856:	83 7d e0 00          	cmpl   $0x0,-0x20(%ebp)
  10385a:	75 24                	jne    103880 <default_check+0x2f9>
  10385c:	c7 44 24 0c 60 6a 10 	movl   $0x106a60,0xc(%esp)
  103863:	00 
  103864:	c7 44 24 08 d6 67 10 	movl   $0x1067d6,0x8(%esp)
  10386b:	00 
  10386c:	c7 44 24 04 51 01 00 	movl   $0x151,0x4(%esp)
  103873:	00 
  103874:	c7 04 24 eb 67 10 00 	movl   $0x1067eb,(%esp)
  10387b:	e8 b3 d3 ff ff       	call   100c33 <__panic>
    assert(alloc_page() == NULL);// 确保没有页面可分配
  103880:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  103887:	e8 8f 06 00 00       	call   103f1b <alloc_pages>
  10388c:	85 c0                	test   %eax,%eax
  10388e:	74 24                	je     1038b4 <default_check+0x32d>
  103890:	c7 44 24 0c 76 69 10 	movl   $0x106976,0xc(%esp)
  103897:	00 
  103898:	c7 44 24 08 d6 67 10 	movl   $0x1067d6,0x8(%esp)
  10389f:	00 
  1038a0:	c7 44 24 04 52 01 00 	movl   $0x152,0x4(%esp)
  1038a7:	00 
  1038a8:	c7 04 24 eb 67 10 00 	movl   $0x1067eb,(%esp)
  1038af:	e8 7f d3 ff ff       	call   100c33 <__panic>
    assert(p0 + 2 == p1);// 确保分配的页面是释放的页面
  1038b4:	8b 45 e8             	mov    -0x18(%ebp),%eax
  1038b7:	83 c0 28             	add    $0x28,%eax
  1038ba:	39 45 e0             	cmp    %eax,-0x20(%ebp)
  1038bd:	74 24                	je     1038e3 <default_check+0x35c>
  1038bf:	c7 44 24 0c 7e 6a 10 	movl   $0x106a7e,0xc(%esp)
  1038c6:	00 
  1038c7:	c7 44 24 08 d6 67 10 	movl   $0x1067d6,0x8(%esp)
  1038ce:	00 
  1038cf:	c7 44 24 04 53 01 00 	movl   $0x153,0x4(%esp)
  1038d6:	00 
  1038d7:	c7 04 24 eb 67 10 00 	movl   $0x1067eb,(%esp)
  1038de:	e8 50 d3 ff ff       	call   100c33 <__panic>

    p2 = p0 + 1; // 设置 p2 为 p0 的下一个页面
  1038e3:	8b 45 e8             	mov    -0x18(%ebp),%eax
  1038e6:	83 c0 14             	add    $0x14,%eax
  1038e9:	89 45 dc             	mov    %eax,-0x24(%ebp)
    free_page(p0);// 释放 p0 页面
  1038ec:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  1038f3:	00 
  1038f4:	8b 45 e8             	mov    -0x18(%ebp),%eax
  1038f7:	89 04 24             	mov    %eax,(%esp)
  1038fa:	e8 56 06 00 00       	call   103f55 <free_pages>
    free_pages(p1, 3);// 释放 p1 指向的页面
  1038ff:	c7 44 24 04 03 00 00 	movl   $0x3,0x4(%esp)
  103906:	00 
  103907:	8b 45 e0             	mov    -0x20(%ebp),%eax
  10390a:	89 04 24             	mov    %eax,(%esp)
  10390d:	e8 43 06 00 00       	call   103f55 <free_pages>
    assert(PageProperty(p0) && p0->property == 1); // 检查 p0 属性
  103912:	8b 45 e8             	mov    -0x18(%ebp),%eax
  103915:	83 c0 04             	add    $0x4,%eax
  103918:	c7 45 a0 01 00 00 00 	movl   $0x1,-0x60(%ebp)
  10391f:	89 45 9c             	mov    %eax,-0x64(%ebp)
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
  103922:	8b 45 9c             	mov    -0x64(%ebp),%eax
  103925:	8b 55 a0             	mov    -0x60(%ebp),%edx
  103928:	0f a3 10             	bt     %edx,(%eax)
  10392b:	19 c0                	sbb    %eax,%eax
  10392d:	89 45 98             	mov    %eax,-0x68(%ebp)
    return oldbit != 0;
  103930:	83 7d 98 00          	cmpl   $0x0,-0x68(%ebp)
  103934:	0f 95 c0             	setne  %al
  103937:	0f b6 c0             	movzbl %al,%eax
  10393a:	85 c0                	test   %eax,%eax
  10393c:	74 0b                	je     103949 <default_check+0x3c2>
  10393e:	8b 45 e8             	mov    -0x18(%ebp),%eax
  103941:	8b 40 08             	mov    0x8(%eax),%eax
  103944:	83 f8 01             	cmp    $0x1,%eax
  103947:	74 24                	je     10396d <default_check+0x3e6>
  103949:	c7 44 24 0c 8c 6a 10 	movl   $0x106a8c,0xc(%esp)
  103950:	00 
  103951:	c7 44 24 08 d6 67 10 	movl   $0x1067d6,0x8(%esp)
  103958:	00 
  103959:	c7 44 24 04 58 01 00 	movl   $0x158,0x4(%esp)
  103960:	00 
  103961:	c7 04 24 eb 67 10 00 	movl   $0x1067eb,(%esp)
  103968:	e8 c6 d2 ff ff       	call   100c33 <__panic>
    assert(PageProperty(p1) && p1->property == 3); // 检查 p1 属性
  10396d:	8b 45 e0             	mov    -0x20(%ebp),%eax
  103970:	83 c0 04             	add    $0x4,%eax
  103973:	c7 45 94 01 00 00 00 	movl   $0x1,-0x6c(%ebp)
  10397a:	89 45 90             	mov    %eax,-0x70(%ebp)
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
  10397d:	8b 45 90             	mov    -0x70(%ebp),%eax
  103980:	8b 55 94             	mov    -0x6c(%ebp),%edx
  103983:	0f a3 10             	bt     %edx,(%eax)
  103986:	19 c0                	sbb    %eax,%eax
  103988:	89 45 8c             	mov    %eax,-0x74(%ebp)
    return oldbit != 0;
  10398b:	83 7d 8c 00          	cmpl   $0x0,-0x74(%ebp)
  10398f:	0f 95 c0             	setne  %al
  103992:	0f b6 c0             	movzbl %al,%eax
  103995:	85 c0                	test   %eax,%eax
  103997:	74 0b                	je     1039a4 <default_check+0x41d>
  103999:	8b 45 e0             	mov    -0x20(%ebp),%eax
  10399c:	8b 40 08             	mov    0x8(%eax),%eax
  10399f:	83 f8 03             	cmp    $0x3,%eax
  1039a2:	74 24                	je     1039c8 <default_check+0x441>
  1039a4:	c7 44 24 0c b4 6a 10 	movl   $0x106ab4,0xc(%esp)
  1039ab:	00 
  1039ac:	c7 44 24 08 d6 67 10 	movl   $0x1067d6,0x8(%esp)
  1039b3:	00 
  1039b4:	c7 44 24 04 59 01 00 	movl   $0x159,0x4(%esp)
  1039bb:	00 
  1039bc:	c7 04 24 eb 67 10 00 	movl   $0x1067eb,(%esp)
  1039c3:	e8 6b d2 ff ff       	call   100c33 <__panic>
// 确保重分配的页面是之前释放的页面
    assert((p0 = alloc_page()) == p2 - 1);
  1039c8:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  1039cf:	e8 47 05 00 00       	call   103f1b <alloc_pages>
  1039d4:	89 45 e8             	mov    %eax,-0x18(%ebp)
  1039d7:	8b 45 dc             	mov    -0x24(%ebp),%eax
  1039da:	83 e8 14             	sub    $0x14,%eax
  1039dd:	39 45 e8             	cmp    %eax,-0x18(%ebp)
  1039e0:	74 24                	je     103a06 <default_check+0x47f>
  1039e2:	c7 44 24 0c da 6a 10 	movl   $0x106ada,0xc(%esp)
  1039e9:	00 
  1039ea:	c7 44 24 08 d6 67 10 	movl   $0x1067d6,0x8(%esp)
  1039f1:	00 
  1039f2:	c7 44 24 04 5b 01 00 	movl   $0x15b,0x4(%esp)
  1039f9:	00 
  1039fa:	c7 04 24 eb 67 10 00 	movl   $0x1067eb,(%esp)
  103a01:	e8 2d d2 ff ff       	call   100c33 <__panic>
    free_page(p0);// 释放分配的页面
  103a06:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  103a0d:	00 
  103a0e:	8b 45 e8             	mov    -0x18(%ebp),%eax
  103a11:	89 04 24             	mov    %eax,(%esp)
  103a14:	e8 3c 05 00 00       	call   103f55 <free_pages>
    assert((p0 = alloc_pages(2)) == p2 + 1);// 分配 2 个页面并检查
  103a19:	c7 04 24 02 00 00 00 	movl   $0x2,(%esp)
  103a20:	e8 f6 04 00 00       	call   103f1b <alloc_pages>
  103a25:	89 45 e8             	mov    %eax,-0x18(%ebp)
  103a28:	8b 45 dc             	mov    -0x24(%ebp),%eax
  103a2b:	83 c0 14             	add    $0x14,%eax
  103a2e:	39 45 e8             	cmp    %eax,-0x18(%ebp)
  103a31:	74 24                	je     103a57 <default_check+0x4d0>
  103a33:	c7 44 24 0c f8 6a 10 	movl   $0x106af8,0xc(%esp)
  103a3a:	00 
  103a3b:	c7 44 24 08 d6 67 10 	movl   $0x1067d6,0x8(%esp)
  103a42:	00 
  103a43:	c7 44 24 04 5d 01 00 	movl   $0x15d,0x4(%esp)
  103a4a:	00 
  103a4b:	c7 04 24 eb 67 10 00 	movl   $0x1067eb,(%esp)
  103a52:	e8 dc d1 ff ff       	call   100c33 <__panic>
// 释放页面并检查空闲状态
    free_pages(p0, 2);
  103a57:	c7 44 24 04 02 00 00 	movl   $0x2,0x4(%esp)
  103a5e:	00 
  103a5f:	8b 45 e8             	mov    -0x18(%ebp),%eax
  103a62:	89 04 24             	mov    %eax,(%esp)
  103a65:	e8 eb 04 00 00       	call   103f55 <free_pages>
    free_page(p2);
  103a6a:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  103a71:	00 
  103a72:	8b 45 dc             	mov    -0x24(%ebp),%eax
  103a75:	89 04 24             	mov    %eax,(%esp)
  103a78:	e8 d8 04 00 00       	call   103f55 <free_pages>
// 再次分配 5 个页面
    assert((p0 = alloc_pages(5)) != NULL);
  103a7d:	c7 04 24 05 00 00 00 	movl   $0x5,(%esp)
  103a84:	e8 92 04 00 00       	call   103f1b <alloc_pages>
  103a89:	89 45 e8             	mov    %eax,-0x18(%ebp)
  103a8c:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
  103a90:	75 24                	jne    103ab6 <default_check+0x52f>
  103a92:	c7 44 24 0c 18 6b 10 	movl   $0x106b18,0xc(%esp)
  103a99:	00 
  103a9a:	c7 44 24 08 d6 67 10 	movl   $0x1067d6,0x8(%esp)
  103aa1:	00 
  103aa2:	c7 44 24 04 62 01 00 	movl   $0x162,0x4(%esp)
  103aa9:	00 
  103aaa:	c7 04 24 eb 67 10 00 	movl   $0x1067eb,(%esp)
  103ab1:	e8 7d d1 ff ff       	call   100c33 <__panic>
    assert(alloc_page() == NULL);// 确保没有额外页面可分配
  103ab6:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  103abd:	e8 59 04 00 00       	call   103f1b <alloc_pages>
  103ac2:	85 c0                	test   %eax,%eax
  103ac4:	74 24                	je     103aea <default_check+0x563>
  103ac6:	c7 44 24 0c 76 69 10 	movl   $0x106976,0xc(%esp)
  103acd:	00 
  103ace:	c7 44 24 08 d6 67 10 	movl   $0x1067d6,0x8(%esp)
  103ad5:	00 
  103ad6:	c7 44 24 04 63 01 00 	movl   $0x163,0x4(%esp)
  103add:	00 
  103ade:	c7 04 24 eb 67 10 00 	movl   $0x1067eb,(%esp)
  103ae5:	e8 49 d1 ff ff       	call   100c33 <__panic>

    assert(nr_free == 0);// 确保空闲页数为 0
  103aea:	a1 e8 ce 11 00       	mov    0x11cee8,%eax
  103aef:	85 c0                	test   %eax,%eax
  103af1:	74 24                	je     103b17 <default_check+0x590>
  103af3:	c7 44 24 0c c9 69 10 	movl   $0x1069c9,0xc(%esp)
  103afa:	00 
  103afb:	c7 44 24 08 d6 67 10 	movl   $0x1067d6,0x8(%esp)
  103b02:	00 
  103b03:	c7 44 24 04 65 01 00 	movl   $0x165,0x4(%esp)
  103b0a:	00 
  103b0b:	c7 04 24 eb 67 10 00 	movl   $0x1067eb,(%esp)
  103b12:	e8 1c d1 ff ff       	call   100c33 <__panic>
    nr_free = nr_free_store;// 恢复空闲页数
  103b17:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  103b1a:	a3 e8 ce 11 00       	mov    %eax,0x11cee8
// 恢复空闲列表状态
    free_list = free_list_store;
  103b1f:	8b 45 80             	mov    -0x80(%ebp),%eax
  103b22:	8b 55 84             	mov    -0x7c(%ebp),%edx
  103b25:	a3 e0 ce 11 00       	mov    %eax,0x11cee0
  103b2a:	89 15 e4 ce 11 00    	mov    %edx,0x11cee4
    free_pages(p0, 5);// 释放所有分配的页面
  103b30:	c7 44 24 04 05 00 00 	movl   $0x5,0x4(%esp)
  103b37:	00 
  103b38:	8b 45 e8             	mov    -0x18(%ebp),%eax
  103b3b:	89 04 24             	mov    %eax,(%esp)
  103b3e:	e8 12 04 00 00       	call   103f55 <free_pages>
    // 验证空闲列表的一致性
    le = &free_list;
  103b43:	c7 45 ec e0 ce 11 00 	movl   $0x11cee0,-0x14(%ebp)
    while ((le = list_next(le)) != &free_list) {
  103b4a:	eb 1c                	jmp    103b68 <default_check+0x5e1>
        //assert(le->next->prev == le && le->prev->next == le);// 验证双向链表
        struct Page *p = le2page(le, page_link);// 更新计数和总属性值
  103b4c:	8b 45 ec             	mov    -0x14(%ebp),%eax
  103b4f:	83 e8 0c             	sub    $0xc,%eax
  103b52:	89 45 d8             	mov    %eax,-0x28(%ebp)
        count --, total -= p->property;
  103b55:	ff 4d f4             	decl   -0xc(%ebp)
  103b58:	8b 55 f0             	mov    -0x10(%ebp),%edx
  103b5b:	8b 45 d8             	mov    -0x28(%ebp),%eax
  103b5e:	8b 48 08             	mov    0x8(%eax),%ecx
  103b61:	89 d0                	mov    %edx,%eax
  103b63:	29 c8                	sub    %ecx,%eax
  103b65:	89 45 f0             	mov    %eax,-0x10(%ebp)
  103b68:	8b 45 ec             	mov    -0x14(%ebp),%eax
  103b6b:	89 45 88             	mov    %eax,-0x78(%ebp)
    return listelm->next;
  103b6e:	8b 45 88             	mov    -0x78(%ebp),%eax
  103b71:	8b 40 04             	mov    0x4(%eax),%eax
    while ((le = list_next(le)) != &free_list) {
  103b74:	89 45 ec             	mov    %eax,-0x14(%ebp)
  103b77:	81 7d ec e0 ce 11 00 	cmpl   $0x11cee0,-0x14(%ebp)
  103b7e:	75 cc                	jne    103b4c <default_check+0x5c5>
    }
    assert(count == 0);// 确保所有页面都已处理
  103b80:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
  103b84:	74 24                	je     103baa <default_check+0x623>
  103b86:	c7 44 24 0c 36 6b 10 	movl   $0x106b36,0xc(%esp)
  103b8d:	00 
  103b8e:	c7 44 24 08 d6 67 10 	movl   $0x1067d6,0x8(%esp)
  103b95:	00 
  103b96:	c7 44 24 04 71 01 00 	movl   $0x171,0x4(%esp)
  103b9d:	00 
  103b9e:	c7 04 24 eb 67 10 00 	movl   $0x1067eb,(%esp)
  103ba5:	e8 89 d0 ff ff       	call   100c33 <__panic>
    assert(total == 0);// 确保总属性值为 0
  103baa:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
  103bae:	74 24                	je     103bd4 <default_check+0x64d>
  103bb0:	c7 44 24 0c 41 6b 10 	movl   $0x106b41,0xc(%esp)
  103bb7:	00 
  103bb8:	c7 44 24 08 d6 67 10 	movl   $0x1067d6,0x8(%esp)
  103bbf:	00 
  103bc0:	c7 44 24 04 72 01 00 	movl   $0x172,0x4(%esp)
  103bc7:	00 
  103bc8:	c7 04 24 eb 67 10 00 	movl   $0x1067eb,(%esp)
  103bcf:	e8 5f d0 ff ff       	call   100c33 <__panic>
}
  103bd4:	90                   	nop
  103bd5:	89 ec                	mov    %ebp,%esp
  103bd7:	5d                   	pop    %ebp
  103bd8:	c3                   	ret    

00103bd9 <page2ppn>:
page2ppn(struct Page *page) {
  103bd9:	55                   	push   %ebp
  103bda:	89 e5                	mov    %esp,%ebp
    return page - pages;
  103bdc:	8b 15 00 cf 11 00    	mov    0x11cf00,%edx
  103be2:	8b 45 08             	mov    0x8(%ebp),%eax
  103be5:	29 d0                	sub    %edx,%eax
  103be7:	c1 f8 02             	sar    $0x2,%eax
  103bea:	69 c0 cd cc cc cc    	imul   $0xcccccccd,%eax,%eax
}
  103bf0:	5d                   	pop    %ebp
  103bf1:	c3                   	ret    

00103bf2 <page2pa>:
page2pa(struct Page *page) {
  103bf2:	55                   	push   %ebp
  103bf3:	89 e5                	mov    %esp,%ebp
  103bf5:	83 ec 04             	sub    $0x4,%esp
    return page2ppn(page) << PGSHIFT;
  103bf8:	8b 45 08             	mov    0x8(%ebp),%eax
  103bfb:	89 04 24             	mov    %eax,(%esp)
  103bfe:	e8 d6 ff ff ff       	call   103bd9 <page2ppn>
  103c03:	c1 e0 0c             	shl    $0xc,%eax
}
  103c06:	89 ec                	mov    %ebp,%esp
  103c08:	5d                   	pop    %ebp
  103c09:	c3                   	ret    

00103c0a <pa2page>:
pa2page(uintptr_t pa) {
  103c0a:	55                   	push   %ebp
  103c0b:	89 e5                	mov    %esp,%ebp
  103c0d:	83 ec 18             	sub    $0x18,%esp
    if (PPN(pa) >= npage) {
  103c10:	8b 45 08             	mov    0x8(%ebp),%eax
  103c13:	c1 e8 0c             	shr    $0xc,%eax
  103c16:	89 c2                	mov    %eax,%edx
  103c18:	a1 04 cf 11 00       	mov    0x11cf04,%eax
  103c1d:	39 c2                	cmp    %eax,%edx
  103c1f:	72 1c                	jb     103c3d <pa2page+0x33>
        panic("pa2page called with invalid pa");
  103c21:	c7 44 24 08 7c 6b 10 	movl   $0x106b7c,0x8(%esp)
  103c28:	00 
  103c29:	c7 44 24 04 5a 00 00 	movl   $0x5a,0x4(%esp)
  103c30:	00 
  103c31:	c7 04 24 9b 6b 10 00 	movl   $0x106b9b,(%esp)
  103c38:	e8 f6 cf ff ff       	call   100c33 <__panic>
    return &pages[PPN(pa)];
  103c3d:	8b 0d 00 cf 11 00    	mov    0x11cf00,%ecx
  103c43:	8b 45 08             	mov    0x8(%ebp),%eax
  103c46:	c1 e8 0c             	shr    $0xc,%eax
  103c49:	89 c2                	mov    %eax,%edx
  103c4b:	89 d0                	mov    %edx,%eax
  103c4d:	c1 e0 02             	shl    $0x2,%eax
  103c50:	01 d0                	add    %edx,%eax
  103c52:	c1 e0 02             	shl    $0x2,%eax
  103c55:	01 c8                	add    %ecx,%eax
}
  103c57:	89 ec                	mov    %ebp,%esp
  103c59:	5d                   	pop    %ebp
  103c5a:	c3                   	ret    

00103c5b <page2kva>:
page2kva(struct Page *page) {
  103c5b:	55                   	push   %ebp
  103c5c:	89 e5                	mov    %esp,%ebp
  103c5e:	83 ec 28             	sub    $0x28,%esp
    return KADDR(page2pa(page));
  103c61:	8b 45 08             	mov    0x8(%ebp),%eax
  103c64:	89 04 24             	mov    %eax,(%esp)
  103c67:	e8 86 ff ff ff       	call   103bf2 <page2pa>
  103c6c:	89 45 f4             	mov    %eax,-0xc(%ebp)
  103c6f:	8b 45 f4             	mov    -0xc(%ebp),%eax
  103c72:	c1 e8 0c             	shr    $0xc,%eax
  103c75:	89 45 f0             	mov    %eax,-0x10(%ebp)
  103c78:	a1 04 cf 11 00       	mov    0x11cf04,%eax
  103c7d:	39 45 f0             	cmp    %eax,-0x10(%ebp)
  103c80:	72 23                	jb     103ca5 <page2kva+0x4a>
  103c82:	8b 45 f4             	mov    -0xc(%ebp),%eax
  103c85:	89 44 24 0c          	mov    %eax,0xc(%esp)
  103c89:	c7 44 24 08 ac 6b 10 	movl   $0x106bac,0x8(%esp)
  103c90:	00 
  103c91:	c7 44 24 04 61 00 00 	movl   $0x61,0x4(%esp)
  103c98:	00 
  103c99:	c7 04 24 9b 6b 10 00 	movl   $0x106b9b,(%esp)
  103ca0:	e8 8e cf ff ff       	call   100c33 <__panic>
  103ca5:	8b 45 f4             	mov    -0xc(%ebp),%eax
  103ca8:	2d 00 00 00 40       	sub    $0x40000000,%eax
}
  103cad:	89 ec                	mov    %ebp,%esp
  103caf:	5d                   	pop    %ebp
  103cb0:	c3                   	ret    

00103cb1 <pte2page>:
pte2page(pte_t pte) {
  103cb1:	55                   	push   %ebp
  103cb2:	89 e5                	mov    %esp,%ebp
  103cb4:	83 ec 18             	sub    $0x18,%esp
    if (!(pte & PTE_P)) {
  103cb7:	8b 45 08             	mov    0x8(%ebp),%eax
  103cba:	83 e0 01             	and    $0x1,%eax
  103cbd:	85 c0                	test   %eax,%eax
  103cbf:	75 1c                	jne    103cdd <pte2page+0x2c>
        panic("pte2page called with invalid pte");
  103cc1:	c7 44 24 08 d0 6b 10 	movl   $0x106bd0,0x8(%esp)
  103cc8:	00 
  103cc9:	c7 44 24 04 6c 00 00 	movl   $0x6c,0x4(%esp)
  103cd0:	00 
  103cd1:	c7 04 24 9b 6b 10 00 	movl   $0x106b9b,(%esp)
  103cd8:	e8 56 cf ff ff       	call   100c33 <__panic>
    return pa2page(PTE_ADDR(pte));
  103cdd:	8b 45 08             	mov    0x8(%ebp),%eax
  103ce0:	25 00 f0 ff ff       	and    $0xfffff000,%eax
  103ce5:	89 04 24             	mov    %eax,(%esp)
  103ce8:	e8 1d ff ff ff       	call   103c0a <pa2page>
}
  103ced:	89 ec                	mov    %ebp,%esp
  103cef:	5d                   	pop    %ebp
  103cf0:	c3                   	ret    

00103cf1 <pde2page>:
pde2page(pde_t pde) {
  103cf1:	55                   	push   %ebp
  103cf2:	89 e5                	mov    %esp,%ebp
  103cf4:	83 ec 18             	sub    $0x18,%esp
    return pa2page(PDE_ADDR(pde));
  103cf7:	8b 45 08             	mov    0x8(%ebp),%eax
  103cfa:	25 00 f0 ff ff       	and    $0xfffff000,%eax
  103cff:	89 04 24             	mov    %eax,(%esp)
  103d02:	e8 03 ff ff ff       	call   103c0a <pa2page>
}
  103d07:	89 ec                	mov    %ebp,%esp
  103d09:	5d                   	pop    %ebp
  103d0a:	c3                   	ret    

00103d0b <page_ref>:
page_ref(struct Page *page) {
  103d0b:	55                   	push   %ebp
  103d0c:	89 e5                	mov    %esp,%ebp
    return page->ref;
  103d0e:	8b 45 08             	mov    0x8(%ebp),%eax
  103d11:	8b 00                	mov    (%eax),%eax
}
  103d13:	5d                   	pop    %ebp
  103d14:	c3                   	ret    

00103d15 <set_page_ref>:
set_page_ref(struct Page *page, int val) {
  103d15:	55                   	push   %ebp
  103d16:	89 e5                	mov    %esp,%ebp
    page->ref = val;
  103d18:	8b 45 08             	mov    0x8(%ebp),%eax
  103d1b:	8b 55 0c             	mov    0xc(%ebp),%edx
  103d1e:	89 10                	mov    %edx,(%eax)
}
  103d20:	90                   	nop
  103d21:	5d                   	pop    %ebp
  103d22:	c3                   	ret    

00103d23 <page_ref_inc>:

static inline int
page_ref_inc(struct Page *page) {
  103d23:	55                   	push   %ebp
  103d24:	89 e5                	mov    %esp,%ebp
    page->ref += 1;
  103d26:	8b 45 08             	mov    0x8(%ebp),%eax
  103d29:	8b 00                	mov    (%eax),%eax
  103d2b:	8d 50 01             	lea    0x1(%eax),%edx
  103d2e:	8b 45 08             	mov    0x8(%ebp),%eax
  103d31:	89 10                	mov    %edx,(%eax)
    return page->ref;
  103d33:	8b 45 08             	mov    0x8(%ebp),%eax
  103d36:	8b 00                	mov    (%eax),%eax
}
  103d38:	5d                   	pop    %ebp
  103d39:	c3                   	ret    

00103d3a <page_ref_dec>:

static inline int
page_ref_dec(struct Page *page) {
  103d3a:	55                   	push   %ebp
  103d3b:	89 e5                	mov    %esp,%ebp
    page->ref -= 1;
  103d3d:	8b 45 08             	mov    0x8(%ebp),%eax
  103d40:	8b 00                	mov    (%eax),%eax
  103d42:	8d 50 ff             	lea    -0x1(%eax),%edx
  103d45:	8b 45 08             	mov    0x8(%ebp),%eax
  103d48:	89 10                	mov    %edx,(%eax)
    return page->ref;
  103d4a:	8b 45 08             	mov    0x8(%ebp),%eax
  103d4d:	8b 00                	mov    (%eax),%eax
}
  103d4f:	5d                   	pop    %ebp
  103d50:	c3                   	ret    

00103d51 <__intr_save>:
__intr_save(void) {
  103d51:	55                   	push   %ebp
  103d52:	89 e5                	mov    %esp,%ebp
  103d54:	83 ec 18             	sub    $0x18,%esp
    asm volatile ("pushfl; popl %0" : "=r" (eflags));
  103d57:	9c                   	pushf  
  103d58:	58                   	pop    %eax
  103d59:	89 45 f4             	mov    %eax,-0xc(%ebp)
    return eflags;
  103d5c:	8b 45 f4             	mov    -0xc(%ebp),%eax
    if (read_eflags() & FL_IF) {
  103d5f:	25 00 02 00 00       	and    $0x200,%eax
  103d64:	85 c0                	test   %eax,%eax
  103d66:	74 0c                	je     103d74 <__intr_save+0x23>
        intr_disable();
  103d68:	e8 1f d9 ff ff       	call   10168c <intr_disable>
        return 1;
  103d6d:	b8 01 00 00 00       	mov    $0x1,%eax
  103d72:	eb 05                	jmp    103d79 <__intr_save+0x28>
    return 0;
  103d74:	b8 00 00 00 00       	mov    $0x0,%eax
}
  103d79:	89 ec                	mov    %ebp,%esp
  103d7b:	5d                   	pop    %ebp
  103d7c:	c3                   	ret    

00103d7d <__intr_restore>:
__intr_restore(bool flag) {
  103d7d:	55                   	push   %ebp
  103d7e:	89 e5                	mov    %esp,%ebp
  103d80:	83 ec 08             	sub    $0x8,%esp
    if (flag) {
  103d83:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
  103d87:	74 05                	je     103d8e <__intr_restore+0x11>
        intr_enable();
  103d89:	e8 f6 d8 ff ff       	call   101684 <intr_enable>
}
  103d8e:	90                   	nop
  103d8f:	89 ec                	mov    %ebp,%esp
  103d91:	5d                   	pop    %ebp
  103d92:	c3                   	ret    

00103d93 <lgdt>:
 * data/code segement registers for kernel.
 * lgdt - 加载全局描述符表寄存器并重置内核的数据/代码段寄存器。
 * */
//定义了一个静态内联函数 lgdt，接收一个指向伪描述符（struct pseudodesc）的指针 pd
static inline void
lgdt(struct pseudodesc *pd) {
  103d93:	55                   	push   %ebp
  103d94:	89 e5                	mov    %esp,%ebp
    asm volatile ("lgdt (%0)" :: "r" (pd));//这行汇编代码使用 lgdt 指令加载 GDT。%0 被替换为指向 pd 的指针，告诉处理器 GDT 的地址。
  103d96:	8b 45 08             	mov    0x8(%ebp),%eax
  103d99:	0f 01 10             	lgdtl  (%eax)
    asm volatile ("movw %%ax, %%gs" :: "a" (USER_DS));//将 USER_DS（用户数据段）的值移动到 gs 段寄存器。
  103d9c:	b8 23 00 00 00       	mov    $0x23,%eax
  103da1:	8e e8                	mov    %eax,%gs
    asm volatile ("movw %%ax, %%fs" :: "a" (USER_DS));//将 USER_DS 的值移动到 fs 段寄存器。
  103da3:	b8 23 00 00 00       	mov    $0x23,%eax
  103da8:	8e e0                	mov    %eax,%fs
    asm volatile ("movw %%ax, %%es" :: "a" (KERNEL_DS));//将 KERNEL_DS（内核数据段）的值移动到 es 段寄存器。
  103daa:	b8 10 00 00 00       	mov    $0x10,%eax
  103daf:	8e c0                	mov    %eax,%es
    asm volatile ("movw %%ax, %%ds" :: "a" (KERNEL_DS));//将 KERNEL_DS 的值移动到 ds 段寄存器
  103db1:	b8 10 00 00 00       	mov    $0x10,%eax
  103db6:	8e d8                	mov    %eax,%ds
    asm volatile ("movw %%ax, %%ss" :: "a" (KERNEL_DS));//将 KERNEL_DS 的值移动到 ss 段寄存器
  103db8:	b8 10 00 00 00       	mov    $0x10,%eax
  103dbd:	8e d0                	mov    %eax,%ss
    // reload cs
    //通过 ljmp 指令重新加载代码段寄存器 cs，并跳转到标签 1。
    asm volatile ("ljmp %0, $1f\n 1:\n" :: "i" (KERNEL_CS));
  103dbf:	ea c6 3d 10 00 08 00 	ljmp   $0x8,$0x103dc6
}
  103dc6:	90                   	nop
  103dc7:	5d                   	pop    %ebp
  103dc8:	c3                   	ret    

00103dc9 <load_esp0>:
 *  load_esp0 - 修改默认任务状态段中的 ESP0，以便在从用户态陷入内核态时能够使用不同的内核栈。
 * */
//uintptr_t esp0：这是新的堆栈指针，通常指向内核栈的顶部。
//修改当前任务状态段（TSS）中的 ESP0 值。ESP0 是在从用户态切换到内核态时，CPU 使用的内核栈指针。
void
load_esp0(uintptr_t esp0) {
  103dc9:	55                   	push   %ebp
  103dca:	89 e5                	mov    %esp,%ebp
    ts.ts_esp0 = esp0;
  103dcc:	8b 45 08             	mov    0x8(%ebp),%eax
  103dcf:	a3 24 cf 11 00       	mov    %eax,0x11cf24
}
  103dd4:	90                   	nop
  103dd5:	5d                   	pop    %ebp
  103dd6:	c3                   	ret    

00103dd7 <gdt_init>:

/* gdt_init - initialize the default GDT and TSS */
/* gdt_init - 初始化默认的 GDT 和 TSS */
static void
gdt_init(void) {
  103dd7:	55                   	push   %ebp
  103dd8:	89 e5                	mov    %esp,%ebp
  103dda:	83 ec 14             	sub    $0x14,%esp
    // 设置启动内核栈和默认的 SS0
    // set boot kernel stack and default SS0
    load_esp0((uintptr_t)bootstacktop);
  103ddd:	b8 00 90 11 00       	mov    $0x119000,%eax
  103de2:	89 04 24             	mov    %eax,(%esp)
  103de5:	e8 df ff ff ff       	call   103dc9 <load_esp0>
    ts.ts_ss0 = KERNEL_DS;
  103dea:	66 c7 05 28 cf 11 00 	movw   $0x10,0x11cf28
  103df1:	10 00 
    // 初始化 GDT 中的 TSS 字段
    // initialize the TSS filed of the gdt
    gdt[SEG_TSS] = SEGTSS(STS_T32A, (uintptr_t)&ts, sizeof(ts), DPL_KERNEL);
  103df3:	66 c7 05 28 9a 11 00 	movw   $0x68,0x119a28
  103dfa:	68 00 
  103dfc:	b8 20 cf 11 00       	mov    $0x11cf20,%eax
  103e01:	0f b7 c0             	movzwl %ax,%eax
  103e04:	66 a3 2a 9a 11 00    	mov    %ax,0x119a2a
  103e0a:	b8 20 cf 11 00       	mov    $0x11cf20,%eax
  103e0f:	c1 e8 10             	shr    $0x10,%eax
  103e12:	a2 2c 9a 11 00       	mov    %al,0x119a2c
  103e17:	0f b6 05 2d 9a 11 00 	movzbl 0x119a2d,%eax
  103e1e:	24 f0                	and    $0xf0,%al
  103e20:	0c 09                	or     $0x9,%al
  103e22:	a2 2d 9a 11 00       	mov    %al,0x119a2d
  103e27:	0f b6 05 2d 9a 11 00 	movzbl 0x119a2d,%eax
  103e2e:	24 ef                	and    $0xef,%al
  103e30:	a2 2d 9a 11 00       	mov    %al,0x119a2d
  103e35:	0f b6 05 2d 9a 11 00 	movzbl 0x119a2d,%eax
  103e3c:	24 9f                	and    $0x9f,%al
  103e3e:	a2 2d 9a 11 00       	mov    %al,0x119a2d
  103e43:	0f b6 05 2d 9a 11 00 	movzbl 0x119a2d,%eax
  103e4a:	0c 80                	or     $0x80,%al
  103e4c:	a2 2d 9a 11 00       	mov    %al,0x119a2d
  103e51:	0f b6 05 2e 9a 11 00 	movzbl 0x119a2e,%eax
  103e58:	24 f0                	and    $0xf0,%al
  103e5a:	a2 2e 9a 11 00       	mov    %al,0x119a2e
  103e5f:	0f b6 05 2e 9a 11 00 	movzbl 0x119a2e,%eax
  103e66:	24 ef                	and    $0xef,%al
  103e68:	a2 2e 9a 11 00       	mov    %al,0x119a2e
  103e6d:	0f b6 05 2e 9a 11 00 	movzbl 0x119a2e,%eax
  103e74:	24 df                	and    $0xdf,%al
  103e76:	a2 2e 9a 11 00       	mov    %al,0x119a2e
  103e7b:	0f b6 05 2e 9a 11 00 	movzbl 0x119a2e,%eax
  103e82:	0c 40                	or     $0x40,%al
  103e84:	a2 2e 9a 11 00       	mov    %al,0x119a2e
  103e89:	0f b6 05 2e 9a 11 00 	movzbl 0x119a2e,%eax
  103e90:	24 7f                	and    $0x7f,%al
  103e92:	a2 2e 9a 11 00       	mov    %al,0x119a2e
  103e97:	b8 20 cf 11 00       	mov    $0x11cf20,%eax
  103e9c:	c1 e8 18             	shr    $0x18,%eax
  103e9f:	a2 2f 9a 11 00       	mov    %al,0x119a2f
    // 使用lgdt加载全局描述符表，更新所有段寄存器
    // reload all segment registers
    lgdt(&gdt_pd);
  103ea4:	c7 04 24 30 9a 11 00 	movl   $0x119a30,(%esp)
  103eab:	e8 e3 fe ff ff       	call   103d93 <lgdt>
  103eb0:	66 c7 45 fe 28 00    	movw   $0x28,-0x2(%ebp)
    asm volatile ("ltr %0" :: "r" (sel) : "memory");
  103eb6:	0f b7 45 fe          	movzwl -0x2(%ebp),%eax
  103eba:	0f 00 d8             	ltr    %ax
}
  103ebd:	90                   	nop
    // 加载 TSS，使 CPU 在进行特权级切换时能够正确使用 TSS。
    // load the TSS
    ltr(GD_TSS);
}
  103ebe:	90                   	nop
  103ebf:	89 ec                	mov    %ebp,%esp
  103ec1:	5d                   	pop    %ebp
  103ec2:	c3                   	ret    

00103ec3 <init_pmm_manager>:

//init_pmm_manager - initialize a pmm_manager instance
//初始化一个 pmm_manager 实例
static void
init_pmm_manager(void) {
  103ec3:	55                   	push   %ebp
  103ec4:	89 e5                	mov    %esp,%ebp
  103ec6:	83 ec 18             	sub    $0x18,%esp
    //将 pmm_manager 指向默认的 PMM 管理器实例。
    pmm_manager = &default_pmm_manager;
  103ec9:	c7 05 0c cf 11 00 60 	movl   $0x106b60,0x11cf0c
  103ed0:	6b 10 00 
    //使用 cprintf 打印当前内存管理器的名称。
    cprintf("memory management: %s\n", pmm_manager->name);
  103ed3:	a1 0c cf 11 00       	mov    0x11cf0c,%eax
  103ed8:	8b 00                	mov    (%eax),%eax
  103eda:	89 44 24 04          	mov    %eax,0x4(%esp)
  103ede:	c7 04 24 fc 6b 10 00 	movl   $0x106bfc,(%esp)
  103ee5:	e8 7c c4 ff ff       	call   100366 <cprintf>
    //调用 PMM 管理器的初始化函数，以设置和准备内存管理的相关数据结构。
    pmm_manager->init();
  103eea:	a1 0c cf 11 00       	mov    0x11cf0c,%eax
  103eef:	8b 40 04             	mov    0x4(%eax),%eax
  103ef2:	ff d0                	call   *%eax
}
  103ef4:	90                   	nop
  103ef5:	89 ec                	mov    %ebp,%esp
  103ef7:	5d                   	pop    %ebp
  103ef8:	c3                   	ret    

00103ef9 <init_memmap>:

//init_memmap - call pmm->init_memmap to build Page struct for free memory  
// init_memmap - 调用 pmm->init_memmap 构建空闲内存的 Page 结构
//struct Page *base：指向内存页的基础地址。 size_t n：要初始化的页数。
static void
init_memmap(struct Page *base, size_t n) {
  103ef9:	55                   	push   %ebp
  103efa:	89 e5                	mov    %esp,%ebp
  103efc:	83 ec 18             	sub    $0x18,%esp
    pmm_manager->init_memmap(base, n);
  103eff:	a1 0c cf 11 00       	mov    0x11cf0c,%eax
  103f04:	8b 40 08             	mov    0x8(%eax),%eax
  103f07:	8b 55 0c             	mov    0xc(%ebp),%edx
  103f0a:	89 54 24 04          	mov    %edx,0x4(%esp)
  103f0e:	8b 55 08             	mov    0x8(%ebp),%edx
  103f11:	89 14 24             	mov    %edx,(%esp)
  103f14:	ff d0                	call   *%eax
}
  103f16:	90                   	nop
  103f17:	89 ec                	mov    %ebp,%esp
  103f19:	5d                   	pop    %ebp
  103f1a:	c3                   	ret    

00103f1b <alloc_pages>:

//alloc_pages - call pmm->alloc_pages to allocate a continuous n*PAGESIZE memory 
// alloc_pages - 调用 pmm->alloc_pages 分配连续的 n*PAGESIZE 内存
struct Page *
alloc_pages(size_t n) {
  103f1b:	55                   	push   %ebp
  103f1c:	89 e5                	mov    %esp,%ebp
  103f1e:	83 ec 28             	sub    $0x28,%esp
    struct Page *page=NULL;
  103f21:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    bool intr_flag;
    //使用 local_intr_save 保存当前的中断状态，以避免在分配内存时发生中断。
    local_intr_save(intr_flag);
  103f28:	e8 24 fe ff ff       	call   103d51 <__intr_save>
  103f2d:	89 45 f0             	mov    %eax,-0x10(%ebp)
    {
        //调用物理内存管理器的 alloc_pages 函数分配 n 页的内存。
        page = pmm_manager->alloc_pages(n);
  103f30:	a1 0c cf 11 00       	mov    0x11cf0c,%eax
  103f35:	8b 40 0c             	mov    0xc(%eax),%eax
  103f38:	8b 55 08             	mov    0x8(%ebp),%edx
  103f3b:	89 14 24             	mov    %edx,(%esp)
  103f3e:	ff d0                	call   *%eax
  103f40:	89 45 f4             	mov    %eax,-0xc(%ebp)
    }
    //恢复之前保存的中断状态。
    local_intr_restore(intr_flag);
  103f43:	8b 45 f0             	mov    -0x10(%ebp),%eax
  103f46:	89 04 24             	mov    %eax,(%esp)
  103f49:	e8 2f fe ff ff       	call   103d7d <__intr_restore>
    return page;
  103f4e:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
  103f51:	89 ec                	mov    %ebp,%esp
  103f53:	5d                   	pop    %ebp
  103f54:	c3                   	ret    

00103f55 <free_pages>:

//free_pages - call pmm->free_pages to free a continuous n*PAGESIZE memory 
// free_pages - 调用 pmm->free_pages 释放连续的 n*PAGESIZE 内存
//struct Page *base：指向要释放的内存页的基础地址。size_t n：要释放的页数。
void
free_pages(struct Page *base, size_t n) {
  103f55:	55                   	push   %ebp
  103f56:	89 e5                	mov    %esp,%ebp
  103f58:	83 ec 28             	sub    $0x28,%esp
    bool intr_flag;
    //使用 local_intr_save 保存当前的中断状态，以避免在释放内存时发生中断。
    local_intr_save(intr_flag);
  103f5b:	e8 f1 fd ff ff       	call   103d51 <__intr_save>
  103f60:	89 45 f4             	mov    %eax,-0xc(%ebp)
    {
        //调用物理内存管理器的 free_pages 函数释放 n 页的内存。
        pmm_manager->free_pages(base, n);
  103f63:	a1 0c cf 11 00       	mov    0x11cf0c,%eax
  103f68:	8b 40 10             	mov    0x10(%eax),%eax
  103f6b:	8b 55 0c             	mov    0xc(%ebp),%edx
  103f6e:	89 54 24 04          	mov    %edx,0x4(%esp)
  103f72:	8b 55 08             	mov    0x8(%ebp),%edx
  103f75:	89 14 24             	mov    %edx,(%esp)
  103f78:	ff d0                	call   *%eax
    }
    local_intr_restore(intr_flag);
  103f7a:	8b 45 f4             	mov    -0xc(%ebp),%eax
  103f7d:	89 04 24             	mov    %eax,(%esp)
  103f80:	e8 f8 fd ff ff       	call   103d7d <__intr_restore>
}
  103f85:	90                   	nop
  103f86:	89 ec                	mov    %ebp,%esp
  103f88:	5d                   	pop    %ebp
  103f89:	c3                   	ret    

00103f8a <nr_free_pages>:

//nr_free_pages - call pmm->nr_free_pages to get the size (nr*PAGESIZE) 
//of current free memory
// nr_free_pages - 调用 pmm->nr_free_pages 获取当前空闲内存的大小 (nr * PAGESIZE)
size_t
nr_free_pages(void) {
  103f8a:	55                   	push   %ebp
  103f8b:	89 e5                	mov    %esp,%ebp
  103f8d:	83 ec 28             	sub    $0x28,%esp
    size_t ret;// 定义变量 ret 用于存储返回的空闲内存大小
    bool intr_flag;// 定义变量 intr_flag 用于保存中断状态
    local_intr_save(intr_flag);// 保存当前中断状态，并禁用中断
  103f90:	e8 bc fd ff ff       	call   103d51 <__intr_save>
  103f95:	89 45 f4             	mov    %eax,-0xc(%ebp)
    {
        ret = pmm_manager->nr_free_pages();// 调用物理内存管理器的函数获取空闲内存页数
  103f98:	a1 0c cf 11 00       	mov    0x11cf0c,%eax
  103f9d:	8b 40 14             	mov    0x14(%eax),%eax
  103fa0:	ff d0                	call   *%eax
  103fa2:	89 45 f0             	mov    %eax,-0x10(%ebp)
    }
    local_intr_restore(intr_flag);// 恢复之前保存的中断状态
  103fa5:	8b 45 f4             	mov    -0xc(%ebp),%eax
  103fa8:	89 04 24             	mov    %eax,(%esp)
  103fab:	e8 cd fd ff ff       	call   103d7d <__intr_restore>
    return ret;// 返回空闲内存的大小
  103fb0:	8b 45 f0             	mov    -0x10(%ebp),%eax
}
  103fb3:	89 ec                	mov    %ebp,%esp
  103fb5:	5d                   	pop    %ebp
  103fb6:	c3                   	ret    

00103fb7 <page_init>:

/* pmm_init - initialize the physical memory management */
/* pmm_init - 初始化物理内存管理 */
static void
page_init(void) {
  103fb7:	55                   	push   %ebp
  103fb8:	89 e5                	mov    %esp,%ebp
  103fba:	57                   	push   %edi
  103fbb:	56                   	push   %esi
  103fbc:	53                   	push   %ebx
  103fbd:	81 ec 9c 00 00 00    	sub    $0x9c,%esp
    // 获取物理内存映射信息，存于特定地址
    struct e820map *memmap = (struct e820map *)(0x8000 + KERNBASE);
  103fc3:	c7 45 c4 00 80 00 c0 	movl   $0xc0008000,-0x3c(%ebp)
    uint64_t maxpa = 0;// 初始化最大物理地址为0
  103fca:	c7 45 e0 00 00 00 00 	movl   $0x0,-0x20(%ebp)
  103fd1:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)

    cprintf("e820map:\n");// 打印“e820map”标题
  103fd8:	c7 04 24 13 6c 10 00 	movl   $0x106c13,(%esp)
  103fdf:	e8 82 c3 ff ff       	call   100366 <cprintf>
    int i;
    for (i = 0; i < memmap->nr_map; i ++) {// 遍历内存映射数组
  103fe4:	c7 45 dc 00 00 00 00 	movl   $0x0,-0x24(%ebp)
  103feb:	e9 0c 01 00 00       	jmp    1040fc <page_init+0x145>
        uint64_t begin = memmap->map[i].addr, end = begin + memmap->map[i].size; // 获取每个区域的起始和结束地址
  103ff0:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
  103ff3:	8b 55 dc             	mov    -0x24(%ebp),%edx
  103ff6:	89 d0                	mov    %edx,%eax
  103ff8:	c1 e0 02             	shl    $0x2,%eax
  103ffb:	01 d0                	add    %edx,%eax
  103ffd:	c1 e0 02             	shl    $0x2,%eax
  104000:	01 c8                	add    %ecx,%eax
  104002:	8b 50 08             	mov    0x8(%eax),%edx
  104005:	8b 40 04             	mov    0x4(%eax),%eax
  104008:	89 45 a0             	mov    %eax,-0x60(%ebp)
  10400b:	89 55 a4             	mov    %edx,-0x5c(%ebp)
  10400e:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
  104011:	8b 55 dc             	mov    -0x24(%ebp),%edx
  104014:	89 d0                	mov    %edx,%eax
  104016:	c1 e0 02             	shl    $0x2,%eax
  104019:	01 d0                	add    %edx,%eax
  10401b:	c1 e0 02             	shl    $0x2,%eax
  10401e:	01 c8                	add    %ecx,%eax
  104020:	8b 48 0c             	mov    0xc(%eax),%ecx
  104023:	8b 58 10             	mov    0x10(%eax),%ebx
  104026:	8b 45 a0             	mov    -0x60(%ebp),%eax
  104029:	8b 55 a4             	mov    -0x5c(%ebp),%edx
  10402c:	01 c8                	add    %ecx,%eax
  10402e:	11 da                	adc    %ebx,%edx
  104030:	89 45 98             	mov    %eax,-0x68(%ebp)
  104033:	89 55 9c             	mov    %edx,-0x64(%ebp)
        cprintf("  memory: %08llx, [%08llx, %08llx], type = %d.\n",// 打印内存区域的信息
  104036:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
  104039:	8b 55 dc             	mov    -0x24(%ebp),%edx
  10403c:	89 d0                	mov    %edx,%eax
  10403e:	c1 e0 02             	shl    $0x2,%eax
  104041:	01 d0                	add    %edx,%eax
  104043:	c1 e0 02             	shl    $0x2,%eax
  104046:	01 c8                	add    %ecx,%eax
  104048:	83 c0 14             	add    $0x14,%eax
  10404b:	8b 00                	mov    (%eax),%eax
  10404d:	89 85 7c ff ff ff    	mov    %eax,-0x84(%ebp)
  104053:	8b 45 98             	mov    -0x68(%ebp),%eax
  104056:	8b 55 9c             	mov    -0x64(%ebp),%edx
  104059:	83 c0 ff             	add    $0xffffffff,%eax
  10405c:	83 d2 ff             	adc    $0xffffffff,%edx
  10405f:	89 c6                	mov    %eax,%esi
  104061:	89 d7                	mov    %edx,%edi
  104063:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
  104066:	8b 55 dc             	mov    -0x24(%ebp),%edx
  104069:	89 d0                	mov    %edx,%eax
  10406b:	c1 e0 02             	shl    $0x2,%eax
  10406e:	01 d0                	add    %edx,%eax
  104070:	c1 e0 02             	shl    $0x2,%eax
  104073:	01 c8                	add    %ecx,%eax
  104075:	8b 48 0c             	mov    0xc(%eax),%ecx
  104078:	8b 58 10             	mov    0x10(%eax),%ebx
  10407b:	8b 85 7c ff ff ff    	mov    -0x84(%ebp),%eax
  104081:	89 44 24 1c          	mov    %eax,0x1c(%esp)
  104085:	89 74 24 14          	mov    %esi,0x14(%esp)
  104089:	89 7c 24 18          	mov    %edi,0x18(%esp)
  10408d:	8b 45 a0             	mov    -0x60(%ebp),%eax
  104090:	8b 55 a4             	mov    -0x5c(%ebp),%edx
  104093:	89 44 24 0c          	mov    %eax,0xc(%esp)
  104097:	89 54 24 10          	mov    %edx,0x10(%esp)
  10409b:	89 4c 24 04          	mov    %ecx,0x4(%esp)
  10409f:	89 5c 24 08          	mov    %ebx,0x8(%esp)
  1040a3:	c7 04 24 20 6c 10 00 	movl   $0x106c20,(%esp)
  1040aa:	e8 b7 c2 ff ff       	call   100366 <cprintf>
                memmap->map[i].size, begin, end - 1, memmap->map[i].type);
        if (memmap->map[i].type == E820_ARM) { // 检查内存类型是否为可用内存
  1040af:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
  1040b2:	8b 55 dc             	mov    -0x24(%ebp),%edx
  1040b5:	89 d0                	mov    %edx,%eax
  1040b7:	c1 e0 02             	shl    $0x2,%eax
  1040ba:	01 d0                	add    %edx,%eax
  1040bc:	c1 e0 02             	shl    $0x2,%eax
  1040bf:	01 c8                	add    %ecx,%eax
  1040c1:	83 c0 14             	add    $0x14,%eax
  1040c4:	8b 00                	mov    (%eax),%eax
  1040c6:	83 f8 01             	cmp    $0x1,%eax
  1040c9:	75 2e                	jne    1040f9 <page_init+0x142>
            if (maxpa < end && begin < KMEMSIZE) {// 检查当前区域是否在有效范围内
  1040cb:	8b 45 e0             	mov    -0x20(%ebp),%eax
  1040ce:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  1040d1:	3b 45 98             	cmp    -0x68(%ebp),%eax
  1040d4:	89 d0                	mov    %edx,%eax
  1040d6:	1b 45 9c             	sbb    -0x64(%ebp),%eax
  1040d9:	73 1e                	jae    1040f9 <page_init+0x142>
  1040db:	ba ff ff ff 37       	mov    $0x37ffffff,%edx
  1040e0:	b8 00 00 00 00       	mov    $0x0,%eax
  1040e5:	3b 55 a0             	cmp    -0x60(%ebp),%edx
  1040e8:	1b 45 a4             	sbb    -0x5c(%ebp),%eax
  1040eb:	72 0c                	jb     1040f9 <page_init+0x142>
                maxpa = end;// 更新最大物理地址
  1040ed:	8b 45 98             	mov    -0x68(%ebp),%eax
  1040f0:	8b 55 9c             	mov    -0x64(%ebp),%edx
  1040f3:	89 45 e0             	mov    %eax,-0x20(%ebp)
  1040f6:	89 55 e4             	mov    %edx,-0x1c(%ebp)
    for (i = 0; i < memmap->nr_map; i ++) {// 遍历内存映射数组
  1040f9:	ff 45 dc             	incl   -0x24(%ebp)
  1040fc:	8b 45 c4             	mov    -0x3c(%ebp),%eax
  1040ff:	8b 00                	mov    (%eax),%eax
  104101:	39 45 dc             	cmp    %eax,-0x24(%ebp)
  104104:	0f 8c e6 fe ff ff    	jl     103ff0 <page_init+0x39>
            }
        }
    }
    if (maxpa > KMEMSIZE) {// 如果最大物理地址超过了预定义的内存上限
  10410a:	ba 00 00 00 38       	mov    $0x38000000,%edx
  10410f:	b8 00 00 00 00       	mov    $0x0,%eax
  104114:	3b 55 e0             	cmp    -0x20(%ebp),%edx
  104117:	1b 45 e4             	sbb    -0x1c(%ebp),%eax
  10411a:	73 0e                	jae    10412a <page_init+0x173>
        maxpa = KMEMSIZE;// 将其限制为内存上限
  10411c:	c7 45 e0 00 00 00 38 	movl   $0x38000000,-0x20(%ebp)
  104123:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
    }

    extern char end[];// 引入全局变量 end，指向内存的结束位置

    npage = maxpa / PGSIZE; // 计算可用页数
  10412a:	8b 45 e0             	mov    -0x20(%ebp),%eax
  10412d:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  104130:	0f ac d0 0c          	shrd   $0xc,%edx,%eax
  104134:	c1 ea 0c             	shr    $0xc,%edx
  104137:	a3 04 cf 11 00       	mov    %eax,0x11cf04
    pages = (struct Page *)ROUNDUP((void *)end, PGSIZE);// 将 end 对齐到页边界，指向页结构数组的开头
  10413c:	c7 45 c0 00 10 00 00 	movl   $0x1000,-0x40(%ebp)
  104143:	b8 8c cf 11 00       	mov    $0x11cf8c,%eax
  104148:	8d 50 ff             	lea    -0x1(%eax),%edx
  10414b:	8b 45 c0             	mov    -0x40(%ebp),%eax
  10414e:	01 d0                	add    %edx,%eax
  104150:	89 45 bc             	mov    %eax,-0x44(%ebp)
  104153:	8b 45 bc             	mov    -0x44(%ebp),%eax
  104156:	ba 00 00 00 00       	mov    $0x0,%edx
  10415b:	f7 75 c0             	divl   -0x40(%ebp)
  10415e:	8b 45 bc             	mov    -0x44(%ebp),%eax
  104161:	29 d0                	sub    %edx,%eax
  104163:	a3 00 cf 11 00       	mov    %eax,0x11cf00

    for (i = 0; i < npage; i ++) {// 遍历每一页
  104168:	c7 45 dc 00 00 00 00 	movl   $0x0,-0x24(%ebp)
  10416f:	eb 2f                	jmp    1041a0 <page_init+0x1e9>
        SetPageReserved(pages + i);// 将每一页标记为保留状态
  104171:	8b 0d 00 cf 11 00    	mov    0x11cf00,%ecx
  104177:	8b 55 dc             	mov    -0x24(%ebp),%edx
  10417a:	89 d0                	mov    %edx,%eax
  10417c:	c1 e0 02             	shl    $0x2,%eax
  10417f:	01 d0                	add    %edx,%eax
  104181:	c1 e0 02             	shl    $0x2,%eax
  104184:	01 c8                	add    %ecx,%eax
  104186:	83 c0 04             	add    $0x4,%eax
  104189:	c7 45 94 00 00 00 00 	movl   $0x0,-0x6c(%ebp)
  104190:	89 45 90             	mov    %eax,-0x70(%ebp)
    asm volatile ("btsl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
  104193:	8b 45 90             	mov    -0x70(%ebp),%eax
  104196:	8b 55 94             	mov    -0x6c(%ebp),%edx
  104199:	0f ab 10             	bts    %edx,(%eax)
}
  10419c:	90                   	nop
    for (i = 0; i < npage; i ++) {// 遍历每一页
  10419d:	ff 45 dc             	incl   -0x24(%ebp)
  1041a0:	8b 55 dc             	mov    -0x24(%ebp),%edx
  1041a3:	a1 04 cf 11 00       	mov    0x11cf04,%eax
  1041a8:	39 c2                	cmp    %eax,%edx
  1041aa:	72 c5                	jb     104171 <page_init+0x1ba>
    }

    uintptr_t freemem = PADDR((uintptr_t)pages + sizeof(struct Page) * npage);// 计算可用内存的起始地址
  1041ac:	8b 15 04 cf 11 00    	mov    0x11cf04,%edx
  1041b2:	89 d0                	mov    %edx,%eax
  1041b4:	c1 e0 02             	shl    $0x2,%eax
  1041b7:	01 d0                	add    %edx,%eax
  1041b9:	c1 e0 02             	shl    $0x2,%eax
  1041bc:	89 c2                	mov    %eax,%edx
  1041be:	a1 00 cf 11 00       	mov    0x11cf00,%eax
  1041c3:	01 d0                	add    %edx,%eax
  1041c5:	89 45 b8             	mov    %eax,-0x48(%ebp)
  1041c8:	81 7d b8 ff ff ff bf 	cmpl   $0xbfffffff,-0x48(%ebp)
  1041cf:	77 23                	ja     1041f4 <page_init+0x23d>
  1041d1:	8b 45 b8             	mov    -0x48(%ebp),%eax
  1041d4:	89 44 24 0c          	mov    %eax,0xc(%esp)
  1041d8:	c7 44 24 08 50 6c 10 	movl   $0x106c50,0x8(%esp)
  1041df:	00 
  1041e0:	c7 44 24 04 0c 01 00 	movl   $0x10c,0x4(%esp)
  1041e7:	00 
  1041e8:	c7 04 24 74 6c 10 00 	movl   $0x106c74,(%esp)
  1041ef:	e8 3f ca ff ff       	call   100c33 <__panic>
  1041f4:	8b 45 b8             	mov    -0x48(%ebp),%eax
  1041f7:	05 00 00 00 40       	add    $0x40000000,%eax
  1041fc:	89 45 b4             	mov    %eax,-0x4c(%ebp)

    for (i = 0; i < memmap->nr_map; i ++) {// 再次遍历内存映射
  1041ff:	c7 45 dc 00 00 00 00 	movl   $0x0,-0x24(%ebp)
  104206:	e9 53 01 00 00       	jmp    10435e <page_init+0x3a7>
        uint64_t begin = memmap->map[i].addr, end = begin + memmap->map[i].size;// 获取每个区域的起始和结束地址
  10420b:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
  10420e:	8b 55 dc             	mov    -0x24(%ebp),%edx
  104211:	89 d0                	mov    %edx,%eax
  104213:	c1 e0 02             	shl    $0x2,%eax
  104216:	01 d0                	add    %edx,%eax
  104218:	c1 e0 02             	shl    $0x2,%eax
  10421b:	01 c8                	add    %ecx,%eax
  10421d:	8b 50 08             	mov    0x8(%eax),%edx
  104220:	8b 40 04             	mov    0x4(%eax),%eax
  104223:	89 45 d0             	mov    %eax,-0x30(%ebp)
  104226:	89 55 d4             	mov    %edx,-0x2c(%ebp)
  104229:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
  10422c:	8b 55 dc             	mov    -0x24(%ebp),%edx
  10422f:	89 d0                	mov    %edx,%eax
  104231:	c1 e0 02             	shl    $0x2,%eax
  104234:	01 d0                	add    %edx,%eax
  104236:	c1 e0 02             	shl    $0x2,%eax
  104239:	01 c8                	add    %ecx,%eax
  10423b:	8b 48 0c             	mov    0xc(%eax),%ecx
  10423e:	8b 58 10             	mov    0x10(%eax),%ebx
  104241:	8b 45 d0             	mov    -0x30(%ebp),%eax
  104244:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  104247:	01 c8                	add    %ecx,%eax
  104249:	11 da                	adc    %ebx,%edx
  10424b:	89 45 c8             	mov    %eax,-0x38(%ebp)
  10424e:	89 55 cc             	mov    %edx,-0x34(%ebp)
        if (memmap->map[i].type == E820_ARM) {// 如果区域类型为可用内存
  104251:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
  104254:	8b 55 dc             	mov    -0x24(%ebp),%edx
  104257:	89 d0                	mov    %edx,%eax
  104259:	c1 e0 02             	shl    $0x2,%eax
  10425c:	01 d0                	add    %edx,%eax
  10425e:	c1 e0 02             	shl    $0x2,%eax
  104261:	01 c8                	add    %ecx,%eax
  104263:	83 c0 14             	add    $0x14,%eax
  104266:	8b 00                	mov    (%eax),%eax
  104268:	83 f8 01             	cmp    $0x1,%eax
  10426b:	0f 85 ea 00 00 00    	jne    10435b <page_init+0x3a4>
            if (begin < freemem) { // 如果起始地址小于可用内存地址
  104271:	8b 45 b4             	mov    -0x4c(%ebp),%eax
  104274:	ba 00 00 00 00       	mov    $0x0,%edx
  104279:	8b 4d d4             	mov    -0x2c(%ebp),%ecx
  10427c:	39 45 d0             	cmp    %eax,-0x30(%ebp)
  10427f:	19 d1                	sbb    %edx,%ecx
  104281:	73 0d                	jae    104290 <page_init+0x2d9>
                begin = freemem;// 将起始地址设置为可用内存地址
  104283:	8b 45 b4             	mov    -0x4c(%ebp),%eax
  104286:	89 45 d0             	mov    %eax,-0x30(%ebp)
  104289:	c7 45 d4 00 00 00 00 	movl   $0x0,-0x2c(%ebp)
            }
            if (end > KMEMSIZE) {// 如果结束地址超过内存上限
  104290:	ba 00 00 00 38       	mov    $0x38000000,%edx
  104295:	b8 00 00 00 00       	mov    $0x0,%eax
  10429a:	3b 55 c8             	cmp    -0x38(%ebp),%edx
  10429d:	1b 45 cc             	sbb    -0x34(%ebp),%eax
  1042a0:	73 0e                	jae    1042b0 <page_init+0x2f9>
                end = KMEMSIZE;// 将其限制为内存上限
  1042a2:	c7 45 c8 00 00 00 38 	movl   $0x38000000,-0x38(%ebp)
  1042a9:	c7 45 cc 00 00 00 00 	movl   $0x0,-0x34(%ebp)
            }
            if (begin < end) {// 如果起始地址小于结束地址
  1042b0:	8b 45 d0             	mov    -0x30(%ebp),%eax
  1042b3:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  1042b6:	3b 45 c8             	cmp    -0x38(%ebp),%eax
  1042b9:	89 d0                	mov    %edx,%eax
  1042bb:	1b 45 cc             	sbb    -0x34(%ebp),%eax
  1042be:	0f 83 97 00 00 00    	jae    10435b <page_init+0x3a4>
                begin = ROUNDUP(begin, PGSIZE);// 将起始地址对齐到页边界
  1042c4:	c7 45 b0 00 10 00 00 	movl   $0x1000,-0x50(%ebp)
  1042cb:	8b 55 d0             	mov    -0x30(%ebp),%edx
  1042ce:	8b 45 b0             	mov    -0x50(%ebp),%eax
  1042d1:	01 d0                	add    %edx,%eax
  1042d3:	48                   	dec    %eax
  1042d4:	89 45 ac             	mov    %eax,-0x54(%ebp)
  1042d7:	8b 45 ac             	mov    -0x54(%ebp),%eax
  1042da:	ba 00 00 00 00       	mov    $0x0,%edx
  1042df:	f7 75 b0             	divl   -0x50(%ebp)
  1042e2:	8b 45 ac             	mov    -0x54(%ebp),%eax
  1042e5:	29 d0                	sub    %edx,%eax
  1042e7:	ba 00 00 00 00       	mov    $0x0,%edx
  1042ec:	89 45 d0             	mov    %eax,-0x30(%ebp)
  1042ef:	89 55 d4             	mov    %edx,-0x2c(%ebp)
                end = ROUNDDOWN(end, PGSIZE);// 将结束地址对齐到页边界
  1042f2:	8b 45 c8             	mov    -0x38(%ebp),%eax
  1042f5:	89 45 a8             	mov    %eax,-0x58(%ebp)
  1042f8:	8b 45 a8             	mov    -0x58(%ebp),%eax
  1042fb:	ba 00 00 00 00       	mov    $0x0,%edx
  104300:	89 c7                	mov    %eax,%edi
  104302:	81 e7 00 f0 ff ff    	and    $0xfffff000,%edi
  104308:	89 7d 80             	mov    %edi,-0x80(%ebp)
  10430b:	89 d0                	mov    %edx,%eax
  10430d:	83 e0 00             	and    $0x0,%eax
  104310:	89 45 84             	mov    %eax,-0x7c(%ebp)
  104313:	8b 45 80             	mov    -0x80(%ebp),%eax
  104316:	8b 55 84             	mov    -0x7c(%ebp),%edx
  104319:	89 45 c8             	mov    %eax,-0x38(%ebp)
  10431c:	89 55 cc             	mov    %edx,-0x34(%ebp)
                if (begin < end) {// 如果调整后的起始地址仍小于结束地址
  10431f:	8b 45 d0             	mov    -0x30(%ebp),%eax
  104322:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  104325:	3b 45 c8             	cmp    -0x38(%ebp),%eax
  104328:	89 d0                	mov    %edx,%eax
  10432a:	1b 45 cc             	sbb    -0x34(%ebp),%eax
  10432d:	73 2c                	jae    10435b <page_init+0x3a4>
                    init_memmap(pa2page(begin), (end - begin) / PGSIZE);// 初始化内存页映射
  10432f:	8b 45 c8             	mov    -0x38(%ebp),%eax
  104332:	8b 55 cc             	mov    -0x34(%ebp),%edx
  104335:	2b 45 d0             	sub    -0x30(%ebp),%eax
  104338:	1b 55 d4             	sbb    -0x2c(%ebp),%edx
  10433b:	0f ac d0 0c          	shrd   $0xc,%edx,%eax
  10433f:	c1 ea 0c             	shr    $0xc,%edx
  104342:	89 c3                	mov    %eax,%ebx
  104344:	8b 45 d0             	mov    -0x30(%ebp),%eax
  104347:	89 04 24             	mov    %eax,(%esp)
  10434a:	e8 bb f8 ff ff       	call   103c0a <pa2page>
  10434f:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  104353:	89 04 24             	mov    %eax,(%esp)
  104356:	e8 9e fb ff ff       	call   103ef9 <init_memmap>
    for (i = 0; i < memmap->nr_map; i ++) {// 再次遍历内存映射
  10435b:	ff 45 dc             	incl   -0x24(%ebp)
  10435e:	8b 45 c4             	mov    -0x3c(%ebp),%eax
  104361:	8b 00                	mov    (%eax),%eax
  104363:	39 45 dc             	cmp    %eax,-0x24(%ebp)
  104366:	0f 8c 9f fe ff ff    	jl     10420b <page_init+0x254>
                }
            }
        }
    }
}
  10436c:	90                   	nop
  10436d:	90                   	nop
  10436e:	81 c4 9c 00 00 00    	add    $0x9c,%esp
  104374:	5b                   	pop    %ebx
  104375:	5e                   	pop    %esi
  104376:	5f                   	pop    %edi
  104377:	5d                   	pop    %ebp
  104378:	c3                   	ret    

00104379 <boot_map_segment>:
//la:   需要映射的线性地址（经过 x86 段映射后的地址）
//  size: memory size   size: 内存大小
//  pa:   physical address of this memory  pa:该内存的物理地址
//  perm: permission of this memory    perm: 该内存的权限
static void
boot_map_segment(pde_t *pgdir, uintptr_t la, size_t size, uintptr_t pa, uint32_t perm) {
  104379:	55                   	push   %ebp
  10437a:	89 e5                	mov    %esp,%ebp
  10437c:	83 ec 38             	sub    $0x38,%esp
    // 确保线性地址和物理地址的页偏移相同
    assert(PGOFF(la) == PGOFF(pa));
  10437f:	8b 45 0c             	mov    0xc(%ebp),%eax
  104382:	33 45 14             	xor    0x14(%ebp),%eax
  104385:	25 ff 0f 00 00       	and    $0xfff,%eax
  10438a:	85 c0                	test   %eax,%eax
  10438c:	74 24                	je     1043b2 <boot_map_segment+0x39>
  10438e:	c7 44 24 0c 82 6c 10 	movl   $0x106c82,0xc(%esp)
  104395:	00 
  104396:	c7 44 24 08 99 6c 10 	movl   $0x106c99,0x8(%esp)
  10439d:	00 
  10439e:	c7 44 24 04 2d 01 00 	movl   $0x12d,0x4(%esp)
  1043a5:	00 
  1043a6:	c7 04 24 74 6c 10 00 	movl   $0x106c74,(%esp)
  1043ad:	e8 81 c8 ff ff       	call   100c33 <__panic>
    // 计算需要映射的页数，ROUNDUP 将总大小对齐到下一个页大小的边界
    size_t n = ROUNDUP(size + PGOFF(la), PGSIZE) / PGSIZE;
  1043b2:	c7 45 f0 00 10 00 00 	movl   $0x1000,-0x10(%ebp)
  1043b9:	8b 45 0c             	mov    0xc(%ebp),%eax
  1043bc:	25 ff 0f 00 00       	and    $0xfff,%eax
  1043c1:	89 c2                	mov    %eax,%edx
  1043c3:	8b 45 10             	mov    0x10(%ebp),%eax
  1043c6:	01 c2                	add    %eax,%edx
  1043c8:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1043cb:	01 d0                	add    %edx,%eax
  1043cd:	48                   	dec    %eax
  1043ce:	89 45 ec             	mov    %eax,-0x14(%ebp)
  1043d1:	8b 45 ec             	mov    -0x14(%ebp),%eax
  1043d4:	ba 00 00 00 00       	mov    $0x0,%edx
  1043d9:	f7 75 f0             	divl   -0x10(%ebp)
  1043dc:	8b 45 ec             	mov    -0x14(%ebp),%eax
  1043df:	29 d0                	sub    %edx,%eax
  1043e1:	c1 e8 0c             	shr    $0xc,%eax
  1043e4:	89 45 f4             	mov    %eax,-0xc(%ebp)
    // 将线性地址向下对齐到页边界
    la = ROUNDDOWN(la, PGSIZE);
  1043e7:	8b 45 0c             	mov    0xc(%ebp),%eax
  1043ea:	89 45 e8             	mov    %eax,-0x18(%ebp)
  1043ed:	8b 45 e8             	mov    -0x18(%ebp),%eax
  1043f0:	25 00 f0 ff ff       	and    $0xfffff000,%eax
  1043f5:	89 45 0c             	mov    %eax,0xc(%ebp)
    // 将物理地址向下对齐到页边界
    pa = ROUNDDOWN(pa, PGSIZE);
  1043f8:	8b 45 14             	mov    0x14(%ebp),%eax
  1043fb:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  1043fe:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  104401:	25 00 f0 ff ff       	and    $0xfffff000,%eax
  104406:	89 45 14             	mov    %eax,0x14(%ebp)
    // 循环遍历每一页，直到映射的页数为零
    for (; n > 0; n --, la += PGSIZE, pa += PGSIZE) {
  104409:	eb 68                	jmp    104473 <boot_map_segment+0xfa>
        // 获取当前页的页表项指针，如果不存在则创建新的页表项
        pte_t *ptep = get_pte(pgdir, la, 1);
  10440b:	c7 44 24 08 01 00 00 	movl   $0x1,0x8(%esp)
  104412:	00 
  104413:	8b 45 0c             	mov    0xc(%ebp),%eax
  104416:	89 44 24 04          	mov    %eax,0x4(%esp)
  10441a:	8b 45 08             	mov    0x8(%ebp),%eax
  10441d:	89 04 24             	mov    %eax,(%esp)
  104420:	e8 88 01 00 00       	call   1045ad <get_pte>
  104425:	89 45 e0             	mov    %eax,-0x20(%ebp)
        // 确保页表项指针不为空
        assert(ptep != NULL);
  104428:	83 7d e0 00          	cmpl   $0x0,-0x20(%ebp)
  10442c:	75 24                	jne    104452 <boot_map_segment+0xd9>
  10442e:	c7 44 24 0c ae 6c 10 	movl   $0x106cae,0xc(%esp)
  104435:	00 
  104436:	c7 44 24 08 99 6c 10 	movl   $0x106c99,0x8(%esp)
  10443d:	00 
  10443e:	c7 44 24 04 39 01 00 	movl   $0x139,0x4(%esp)
  104445:	00 
  104446:	c7 04 24 74 6c 10 00 	movl   $0x106c74,(%esp)
  10444d:	e8 e1 c7 ff ff       	call   100c33 <__panic>
         // 设置页表项，包含物理地址、存在位和权限
        *ptep = pa | PTE_P | perm;
  104452:	8b 45 14             	mov    0x14(%ebp),%eax
  104455:	0b 45 18             	or     0x18(%ebp),%eax
  104458:	83 c8 01             	or     $0x1,%eax
  10445b:	89 c2                	mov    %eax,%edx
  10445d:	8b 45 e0             	mov    -0x20(%ebp),%eax
  104460:	89 10                	mov    %edx,(%eax)
    for (; n > 0; n --, la += PGSIZE, pa += PGSIZE) {
  104462:	ff 4d f4             	decl   -0xc(%ebp)
  104465:	81 45 0c 00 10 00 00 	addl   $0x1000,0xc(%ebp)
  10446c:	81 45 14 00 10 00 00 	addl   $0x1000,0x14(%ebp)
  104473:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
  104477:	75 92                	jne    10440b <boot_map_segment+0x92>
    }
}
  104479:	90                   	nop
  10447a:	90                   	nop
  10447b:	89 ec                	mov    %ebp,%esp
  10447d:	5d                   	pop    %ebp
  10447e:	c3                   	ret    

0010447f <boot_alloc_page>:
// return value: the kernel virtual address of this allocated page
//note: this function is used to get the memory for PDT(Page Directory Table)&PT(Page Table)
//boot_alloc_page - 使用 pmm->alloc_pages(1) 分配一页内存.返回值: 分配的页面的内核虚拟地址
//注意: 此函数用于获取页目录表(PDT)和页表(PT)的内存
static void *
boot_alloc_page(void) {
  10447f:	55                   	push   %ebp
  104480:	89 e5                	mov    %esp,%ebp
  104482:	83 ec 28             	sub    $0x28,%esp
    struct Page *p = alloc_page();// 调用分配页面的函数
  104485:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  10448c:	e8 8a fa ff ff       	call   103f1b <alloc_pages>
  104491:	89 45 f4             	mov    %eax,-0xc(%ebp)
    if (p == NULL) {// 检查分配是否成功
  104494:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
  104498:	75 1c                	jne    1044b6 <boot_alloc_page+0x37>
        panic("boot_alloc_page failed.\n");// 如果分配失败，则触发异常
  10449a:	c7 44 24 08 bb 6c 10 	movl   $0x106cbb,0x8(%esp)
  1044a1:	00 
  1044a2:	c7 44 24 04 48 01 00 	movl   $0x148,0x4(%esp)
  1044a9:	00 
  1044aa:	c7 04 24 74 6c 10 00 	movl   $0x106c74,(%esp)
  1044b1:	e8 7d c7 ff ff       	call   100c33 <__panic>
    }
    return page2kva(p);// 返回分配页面的内核虚拟地址
  1044b6:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1044b9:	89 04 24             	mov    %eax,(%esp)
  1044bc:	e8 9a f7 ff ff       	call   103c5b <page2kva>
}
  1044c1:	89 ec                	mov    %ebp,%esp
  1044c3:	5d                   	pop    %ebp
  1044c4:	c3                   	ret    

001044c5 <pmm_init>:
//pmm_init - setup a pmm to manage physical memory, build PDT&PT to setup paging mechanism 
//         - check the correctness of pmm & paging mechanism, print PDT&PT
//pmm_init - 设置物理内存管理器，构建页目录表(PDT)和页表(PT)，以设置分页机制
//           - 检查物理内存管理器和分页机制的正确性，打印页目录表和页表
void
pmm_init(void) {
  1044c5:	55                   	push   %ebp
  1044c6:	89 e5                	mov    %esp,%ebp
  1044c8:	83 ec 38             	sub    $0x38,%esp
    // We've already enabled paging
    // 我们已经启用了分页
    boot_cr3 = PADDR(boot_pgdir);
  1044cb:	a1 e0 99 11 00       	mov    0x1199e0,%eax
  1044d0:	89 45 f4             	mov    %eax,-0xc(%ebp)
  1044d3:	81 7d f4 ff ff ff bf 	cmpl   $0xbfffffff,-0xc(%ebp)
  1044da:	77 23                	ja     1044ff <pmm_init+0x3a>
  1044dc:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1044df:	89 44 24 0c          	mov    %eax,0xc(%esp)
  1044e3:	c7 44 24 08 50 6c 10 	movl   $0x106c50,0x8(%esp)
  1044ea:	00 
  1044eb:	c7 44 24 04 55 01 00 	movl   $0x155,0x4(%esp)
  1044f2:	00 
  1044f3:	c7 04 24 74 6c 10 00 	movl   $0x106c74,(%esp)
  1044fa:	e8 34 c7 ff ff       	call   100c33 <__panic>
  1044ff:	8b 45 f4             	mov    -0xc(%ebp),%eax
  104502:	05 00 00 00 40       	add    $0x40000000,%eax
  104507:	a3 08 cf 11 00       	mov    %eax,0x11cf08
     // 我们需要分配/释放物理内存（粒度为 4KB 或其他大小）。
    // 因此在 pmm.h 中定义了物理内存管理器的框架（struct pmm_manager）。
    // 首先，我们应该基于该框架初始化一个物理内存管理器(pmm)。
    // 然后 pmm 可以分配/释放物理内存。
    // 现在，first_fit/best_fit/worst_fit/buddy_system 的 pmm 都可用。
    init_pmm_manager();// 初始化物理内存管理器
  10450c:	e8 b2 f9 ff ff       	call   103ec3 <init_pmm_manager>

    // detect physical memory space, reserve already used memory,
    // then use pmm->init_memmap to create free page list
    // 检测物理内存空间，保留已经使用的内存，
    // 然后使用 pmm->init_memmap 创建空闲页面列表
    page_init();// 初始化页面管理
  104511:	e8 a1 fa ff ff       	call   103fb7 <page_init>

    //use pmm->check to verify the correctness of the alloc/free function in a pmm
    // 使用 pmm->check 验证 pmm 中分配/释放函数的正确性
    check_alloc_page();// 检查页面分配功能
  104516:	e8 ed 03 00 00       	call   104908 <check_alloc_page>

    check_pgdir();// 检查页目录的状态
  10451b:	e8 09 04 00 00       	call   104929 <check_pgdir>

    // recursively insert boot_pgdir in itself
    // to form a virtual page table at virtual address VPT
    // 递归地将 boot_pgdir 插入到自身中
    // 在虚拟地址 VPT 处形成虚拟页表
    boot_pgdir[PDX(VPT)] = PADDR(boot_pgdir) | PTE_P | PTE_W;// 设置页目录项，映射自身
  104520:	a1 e0 99 11 00       	mov    0x1199e0,%eax
  104525:	89 45 f0             	mov    %eax,-0x10(%ebp)
  104528:	81 7d f0 ff ff ff bf 	cmpl   $0xbfffffff,-0x10(%ebp)
  10452f:	77 23                	ja     104554 <pmm_init+0x8f>
  104531:	8b 45 f0             	mov    -0x10(%ebp),%eax
  104534:	89 44 24 0c          	mov    %eax,0xc(%esp)
  104538:	c7 44 24 08 50 6c 10 	movl   $0x106c50,0x8(%esp)
  10453f:	00 
  104540:	c7 44 24 04 75 01 00 	movl   $0x175,0x4(%esp)
  104547:	00 
  104548:	c7 04 24 74 6c 10 00 	movl   $0x106c74,(%esp)
  10454f:	e8 df c6 ff ff       	call   100c33 <__panic>
  104554:	8b 45 f0             	mov    -0x10(%ebp),%eax
  104557:	8d 90 00 00 00 40    	lea    0x40000000(%eax),%edx
  10455d:	a1 e0 99 11 00       	mov    0x1199e0,%eax
  104562:	05 ac 0f 00 00       	add    $0xfac,%eax
  104567:	83 ca 03             	or     $0x3,%edx
  10456a:	89 10                	mov    %edx,(%eax)

    // map all physical memory to linear memory with base linear addr KERNBASE
    // linear_addr KERNBASE ~ KERNBASE + KMEMSIZE = phy_addr 0 ~ KMEMSIZE
    // 将所有物理内存映射到线性内存，基地址为 KERNBASE
    // 线性地址 KERNBASE ~ KERNBASE + KMEMSIZE = 物理地址 0 ~ KMEMSIZE
    boot_map_segment(boot_pgdir, KERNBASE, KMEMSIZE, 0, PTE_W);// 映射物理内存
  10456c:	a1 e0 99 11 00       	mov    0x1199e0,%eax
  104571:	c7 44 24 10 02 00 00 	movl   $0x2,0x10(%esp)
  104578:	00 
  104579:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
  104580:	00 
  104581:	c7 44 24 08 00 00 00 	movl   $0x38000000,0x8(%esp)
  104588:	38 
  104589:	c7 44 24 04 00 00 00 	movl   $0xc0000000,0x4(%esp)
  104590:	c0 
  104591:	89 04 24             	mov    %eax,(%esp)
  104594:	e8 e0 fd ff ff       	call   104379 <boot_map_segment>
    // then set kernel stack (ss:esp) in TSS, setup TSS in gdt, load TSS
    // 由于我们正在使用引导加载程序的 GDT，
    // 我们应该重新加载 GDT（第二次，也是最后一次），以获取用户段和 TSS
    // 映射虚拟地址 0 ~ 4G = 线性地址 0 ~ 4G
    // 然后在 TSS 中设置内核栈 (ss:esp)，在 gdt 中设置 TSS，加载 TSS
    gdt_init();// 初始化全局描述符表
  104599:	e8 39 f8 ff ff       	call   103dd7 <gdt_init>

    //now the basic virtual memory map(see memalyout.h) is established.
    //check the correctness of the basic virtual memory map.
     // 现在基本的虚拟内存映射（见 memlayout.h）已建立。
    // 检查基础虚拟内存映射的正确性。
    check_boot_pgdir(); // 检查页目录的正确性
  10459e:	e8 24 0a 00 00       	call   104fc7 <check_boot_pgdir>

    print_pgdir(); // 打印页目录表
  1045a3:	e8 a1 0e 00 00       	call   105449 <print_pgdir>

}
  1045a8:	90                   	nop
  1045a9:	89 ec                	mov    %ebp,%esp
  1045ab:	5d                   	pop    %ebp
  1045ac:	c3                   	ret    

001045ad <get_pte>:
//  pgdir:  页目录的内核虚拟基地址
//  la:     需要映射的线性地址
//  create: 一个逻辑值，决定是否为页表分配一页
// 返回值：该 PTE 的内核虚拟地址
pte_t *
get_pte(pde_t *pgdir, uintptr_t la, bool create) {
  1045ad:	55                   	push   %ebp
  1045ae:	89 e5                	mov    %esp,%ebp
  1045b0:	83 ec 38             	sub    $0x38,%esp
                          // (7) set page directory entry's permission
    }
    return NULL;          // (8) return page table entry
#endif
    // (1) 找到页目录项
    pde_t *pdep = &pgdir[PDX(la)];// 使用 PDX 宏获取页目录索引
  1045b3:	8b 45 0c             	mov    0xc(%ebp),%eax
  1045b6:	c1 e8 16             	shr    $0x16,%eax
  1045b9:	8d 14 85 00 00 00 00 	lea    0x0(,%eax,4),%edx
  1045c0:	8b 45 08             	mov    0x8(%ebp),%eax
  1045c3:	01 d0                	add    %edx,%eax
  1045c5:	89 45 f4             	mov    %eax,-0xc(%ebp)
    // (2) 检查页目录项是否存在
    if (!(*pdep & PTE_P)) {// 如果页目录项的存在位 PTE_P 没有被设置
  1045c8:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1045cb:	8b 00                	mov    (%eax),%eax
  1045cd:	83 e0 01             	and    $0x1,%eax
  1045d0:	85 c0                	test   %eax,%eax
  1045d2:	0f 85 af 00 00 00    	jne    104687 <get_pte+0xda>
        struct Page *page;// 声明一个指针，用于指向新分配的页面
        // 检查是否允许创建新页表，或者分配页表失败
        if (!create || (page = alloc_page()) == NULL) {// 如果不允许创建或分配失败
  1045d8:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
  1045dc:	74 15                	je     1045f3 <get_pte+0x46>
  1045de:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  1045e5:	e8 31 f9 ff ff       	call   103f1b <alloc_pages>
  1045ea:	89 45 f0             	mov    %eax,-0x10(%ebp)
  1045ed:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
  1045f1:	75 0a                	jne    1045fd <get_pte+0x50>
            return NULL;// 返回 NULL，表示无法获取页表
  1045f3:	b8 00 00 00 00       	mov    $0x0,%eax
  1045f8:	e9 e7 00 00 00       	jmp    1046e4 <get_pte+0x137>
        }
        // 设置新分配页面的引用计数为 1
        set_page_ref(page, 1);
  1045fd:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  104604:	00 
  104605:	8b 45 f0             	mov    -0x10(%ebp),%eax
  104608:	89 04 24             	mov    %eax,(%esp)
  10460b:	e8 05 f7 ff ff       	call   103d15 <set_page_ref>
        uintptr_t pa = page2pa(page);// 获取新分配页面的物理地址
  104610:	8b 45 f0             	mov    -0x10(%ebp),%eax
  104613:	89 04 24             	mov    %eax,(%esp)
  104616:	e8 d7 f5 ff ff       	call   103bf2 <page2pa>
  10461b:	89 45 ec             	mov    %eax,-0x14(%ebp)
        memset(KADDR(pa), 0, PGSIZE);// 清空新分配的页表内容，初始化为零
  10461e:	8b 45 ec             	mov    -0x14(%ebp),%eax
  104621:	89 45 e8             	mov    %eax,-0x18(%ebp)
  104624:	8b 45 e8             	mov    -0x18(%ebp),%eax
  104627:	c1 e8 0c             	shr    $0xc,%eax
  10462a:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  10462d:	a1 04 cf 11 00       	mov    0x11cf04,%eax
  104632:	39 45 e4             	cmp    %eax,-0x1c(%ebp)
  104635:	72 23                	jb     10465a <get_pte+0xad>
  104637:	8b 45 e8             	mov    -0x18(%ebp),%eax
  10463a:	89 44 24 0c          	mov    %eax,0xc(%esp)
  10463e:	c7 44 24 08 ac 6b 10 	movl   $0x106bac,0x8(%esp)
  104645:	00 
  104646:	c7 44 24 04 ce 01 00 	movl   $0x1ce,0x4(%esp)
  10464d:	00 
  10464e:	c7 04 24 74 6c 10 00 	movl   $0x106c74,(%esp)
  104655:	e8 d9 c5 ff ff       	call   100c33 <__panic>
  10465a:	8b 45 e8             	mov    -0x18(%ebp),%eax
  10465d:	2d 00 00 00 40       	sub    $0x40000000,%eax
  104662:	c7 44 24 08 00 10 00 	movl   $0x1000,0x8(%esp)
  104669:	00 
  10466a:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  104671:	00 
  104672:	89 04 24             	mov    %eax,(%esp)
  104675:	e8 d4 18 00 00       	call   105f4e <memset>
        // 更新页目录项，设置物理地址和权限位
        *pdep = pa | PTE_U | PTE_W | PTE_P;// 将物理地址和权限位（用户可访问、可写、有效）合并设置
  10467a:	8b 45 ec             	mov    -0x14(%ebp),%eax
  10467d:	83 c8 07             	or     $0x7,%eax
  104680:	89 c2                	mov    %eax,%edx
  104682:	8b 45 f4             	mov    -0xc(%ebp),%eax
  104685:	89 10                	mov    %edx,(%eax)
    }
    // 返回指定线性地址 la 对应的页表项的内核虚拟地址
    return &((pte_t *)KADDR(PDE_ADDR(*pdep)))[PTX(la)];// 计算并返回页表项的指针
  104687:	8b 45 f4             	mov    -0xc(%ebp),%eax
  10468a:	8b 00                	mov    (%eax),%eax
  10468c:	25 00 f0 ff ff       	and    $0xfffff000,%eax
  104691:	89 45 e0             	mov    %eax,-0x20(%ebp)
  104694:	8b 45 e0             	mov    -0x20(%ebp),%eax
  104697:	c1 e8 0c             	shr    $0xc,%eax
  10469a:	89 45 dc             	mov    %eax,-0x24(%ebp)
  10469d:	a1 04 cf 11 00       	mov    0x11cf04,%eax
  1046a2:	39 45 dc             	cmp    %eax,-0x24(%ebp)
  1046a5:	72 23                	jb     1046ca <get_pte+0x11d>
  1046a7:	8b 45 e0             	mov    -0x20(%ebp),%eax
  1046aa:	89 44 24 0c          	mov    %eax,0xc(%esp)
  1046ae:	c7 44 24 08 ac 6b 10 	movl   $0x106bac,0x8(%esp)
  1046b5:	00 
  1046b6:	c7 44 24 04 d3 01 00 	movl   $0x1d3,0x4(%esp)
  1046bd:	00 
  1046be:	c7 04 24 74 6c 10 00 	movl   $0x106c74,(%esp)
  1046c5:	e8 69 c5 ff ff       	call   100c33 <__panic>
  1046ca:	8b 45 e0             	mov    -0x20(%ebp),%eax
  1046cd:	2d 00 00 00 40       	sub    $0x40000000,%eax
  1046d2:	89 c2                	mov    %eax,%edx
  1046d4:	8b 45 0c             	mov    0xc(%ebp),%eax
  1046d7:	c1 e8 0c             	shr    $0xc,%eax
  1046da:	25 ff 03 00 00       	and    $0x3ff,%eax
  1046df:	c1 e0 02             	shl    $0x2,%eax
  1046e2:	01 d0                	add    %edx,%eax
}
  1046e4:	89 ec                	mov    %ebp,%esp
  1046e6:	5d                   	pop    %ebp
  1046e7:	c3                   	ret    

001046e8 <get_page>:

//get_page - get related Page struct for linear address la using PDT pgdir
// get_page - 获取与线性地址 la 相关的 Page 结构体，使用页目录 pgdir
struct Page *
get_page(pde_t *pgdir, uintptr_t la, pte_t **ptep_store) {
  1046e8:	55                   	push   %ebp
  1046e9:	89 e5                	mov    %esp,%ebp
  1046eb:	83 ec 28             	sub    $0x28,%esp
     // 调用 get_pte 函数获取对应线性地址 la 的页表项指针
    pte_t *ptep = get_pte(pgdir, la, 0);
  1046ee:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  1046f5:	00 
  1046f6:	8b 45 0c             	mov    0xc(%ebp),%eax
  1046f9:	89 44 24 04          	mov    %eax,0x4(%esp)
  1046fd:	8b 45 08             	mov    0x8(%ebp),%eax
  104700:	89 04 24             	mov    %eax,(%esp)
  104703:	e8 a5 fe ff ff       	call   1045ad <get_pte>
  104708:	89 45 f4             	mov    %eax,-0xc(%ebp)
    // 如果 ptep_store 指针不为 NULL，将 ptep 存储到 ptep_store 指向的位置
    if (ptep_store != NULL) {
  10470b:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
  10470f:	74 08                	je     104719 <get_page+0x31>
        *ptep_store = ptep; // 存储当前页表项的指针
  104711:	8b 45 10             	mov    0x10(%ebp),%eax
  104714:	8b 55 f4             	mov    -0xc(%ebp),%edx
  104717:	89 10                	mov    %edx,(%eax)
    }
    // 检查 ptep 是否有效以及页表项的存在位 PTE_P 是否被设置
    if (ptep != NULL && *ptep & PTE_P) {
  104719:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
  10471d:	74 1b                	je     10473a <get_page+0x52>
  10471f:	8b 45 f4             	mov    -0xc(%ebp),%eax
  104722:	8b 00                	mov    (%eax),%eax
  104724:	83 e0 01             	and    $0x1,%eax
  104727:	85 c0                	test   %eax,%eax
  104729:	74 0f                	je     10473a <get_page+0x52>
        // 返回与页表项对应的 Page 结构体
        return pte2page(*ptep);// 将页表项转换为对应的 Page 结构
  10472b:	8b 45 f4             	mov    -0xc(%ebp),%eax
  10472e:	8b 00                	mov    (%eax),%eax
  104730:	89 04 24             	mov    %eax,(%esp)
  104733:	e8 79 f5 ff ff       	call   103cb1 <pte2page>
  104738:	eb 05                	jmp    10473f <get_page+0x57>
    }
    // 如果未找到有效的页，返回 NULL
    return NULL;
  10473a:	b8 00 00 00 00       	mov    $0x0,%eax
}
  10473f:	89 ec                	mov    %ebp,%esp
  104741:	5d                   	pop    %ebp
  104742:	c3                   	ret    

00104743 <page_remove_pte>:

//page_remove_pte - free an Page sturct which is related linear address la
//                - and clean(invalidate) pte which is related linear address la
//note: PT is changed, so the TLB need to be invalidate 
static inline void
page_remove_pte(pde_t *pgdir, uintptr_t la, pte_t *ptep) {
  104743:	55                   	push   %ebp
  104744:	89 e5                	mov    %esp,%ebp
  104746:	83 ec 28             	sub    $0x28,%esp
                                  //(4) and free this page when page reference reachs 0
                                  //(5) clear second page table entry
                                  //(6) flush tlb
    }
#endif
    if (*ptep & PTE_P) {
  104749:	8b 45 10             	mov    0x10(%ebp),%eax
  10474c:	8b 00                	mov    (%eax),%eax
  10474e:	83 e0 01             	and    $0x1,%eax
  104751:	85 c0                	test   %eax,%eax
  104753:	74 4d                	je     1047a2 <page_remove_pte+0x5f>
        struct Page *page = pte2page(*ptep);// 找到对应的物理页
  104755:	8b 45 10             	mov    0x10(%ebp),%eax
  104758:	8b 00                	mov    (%eax),%eax
  10475a:	89 04 24             	mov    %eax,(%esp)
  10475d:	e8 4f f5 ff ff       	call   103cb1 <pte2page>
  104762:	89 45 f4             	mov    %eax,-0xc(%ebp)
        // 减少物理页的引用计数，如果引用计数为零，释放该物理页
        if (page_ref_dec(page) == 0) {
  104765:	8b 45 f4             	mov    -0xc(%ebp),%eax
  104768:	89 04 24             	mov    %eax,(%esp)
  10476b:	e8 ca f5 ff ff       	call   103d3a <page_ref_dec>
  104770:	85 c0                	test   %eax,%eax
  104772:	75 13                	jne    104787 <page_remove_pte+0x44>
            free_page(page);
  104774:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  10477b:	00 
  10477c:	8b 45 f4             	mov    -0xc(%ebp),%eax
  10477f:	89 04 24             	mov    %eax,(%esp)
  104782:	e8 ce f7 ff ff       	call   103f55 <free_pages>
        }
        *ptep = 0;// 清除页表项
  104787:	8b 45 10             	mov    0x10(%ebp),%eax
  10478a:	c7 00 00 00 00 00    	movl   $0x0,(%eax)
        tlb_invalidate(pgdir, la);// 刷新 TLB
  104790:	8b 45 0c             	mov    0xc(%ebp),%eax
  104793:	89 44 24 04          	mov    %eax,0x4(%esp)
  104797:	8b 45 08             	mov    0x8(%ebp),%eax
  10479a:	89 04 24             	mov    %eax,(%esp)
  10479d:	e8 07 01 00 00       	call   1048a9 <tlb_invalidate>
    }
}
  1047a2:	90                   	nop
  1047a3:	89 ec                	mov    %ebp,%esp
  1047a5:	5d                   	pop    %ebp
  1047a6:	c3                   	ret    

001047a7 <page_remove>:

//page_remove - free an Page which is related linear address la and has an validated pte
//移除一个虚拟地址对应的页面
void
page_remove(pde_t *pgdir, uintptr_t la) {
  1047a7:	55                   	push   %ebp
  1047a8:	89 e5                	mov    %esp,%ebp
  1047aa:	83 ec 28             	sub    $0x28,%esp
    //调用 get_pte 函数获取给定虚拟地址 la 对应的页表项指针 ptep。
    pte_t *ptep = get_pte(pgdir, la, 0);
  1047ad:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  1047b4:	00 
  1047b5:	8b 45 0c             	mov    0xc(%ebp),%eax
  1047b8:	89 44 24 04          	mov    %eax,0x4(%esp)
  1047bc:	8b 45 08             	mov    0x8(%ebp),%eax
  1047bf:	89 04 24             	mov    %eax,(%esp)
  1047c2:	e8 e6 fd ff ff       	call   1045ad <get_pte>
  1047c7:	89 45 f4             	mov    %eax,-0xc(%ebp)
    //如果 ptep 不为 NULL，则调用 page_remove_pte 函数移除该页表项。
    if (ptep != NULL) {
  1047ca:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
  1047ce:	74 19                	je     1047e9 <page_remove+0x42>
        page_remove_pte(pgdir, la, ptep);
  1047d0:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1047d3:	89 44 24 08          	mov    %eax,0x8(%esp)
  1047d7:	8b 45 0c             	mov    0xc(%ebp),%eax
  1047da:	89 44 24 04          	mov    %eax,0x4(%esp)
  1047de:	8b 45 08             	mov    0x8(%ebp),%eax
  1047e1:	89 04 24             	mov    %eax,(%esp)
  1047e4:	e8 5a ff ff ff       	call   104743 <page_remove_pte>
    }
}
  1047e9:	90                   	nop
  1047ea:	89 ec                	mov    %ebp,%esp
  1047ec:	5d                   	pop    %ebp
  1047ed:	c3                   	ret    

001047ee <page_insert>:
//  perm:  the permission of this Page which is setted in related pte
// return value: always 0
//note: PT is changed, so the TLB need to be invalidate 
//将一个页面插入到页表中。
int
page_insert(pde_t *pgdir, struct Page *page, uintptr_t la, uint32_t perm) {
  1047ee:	55                   	push   %ebp
  1047ef:	89 e5                	mov    %esp,%ebp
  1047f1:	83 ec 28             	sub    $0x28,%esp
    //通过 get_pte 函数获取指定虚拟地址 la 对应的页表项指针 ptep。
    pte_t *ptep = get_pte(pgdir, la, 1);
  1047f4:	c7 44 24 08 01 00 00 	movl   $0x1,0x8(%esp)
  1047fb:	00 
  1047fc:	8b 45 10             	mov    0x10(%ebp),%eax
  1047ff:	89 44 24 04          	mov    %eax,0x4(%esp)
  104803:	8b 45 08             	mov    0x8(%ebp),%eax
  104806:	89 04 24             	mov    %eax,(%esp)
  104809:	e8 9f fd ff ff       	call   1045ad <get_pte>
  10480e:	89 45 f4             	mov    %eax,-0xc(%ebp)
    //如果 ptep 为 NULL，表示内存分配失败，返回 -E_NO_MEM。
    if (ptep == NULL) {
  104811:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
  104815:	75 0a                	jne    104821 <page_insert+0x33>
        return -E_NO_MEM;
  104817:	b8 fc ff ff ff       	mov    $0xfffffffc,%eax
  10481c:	e9 84 00 00 00       	jmp    1048a5 <page_insert+0xb7>
    }
    //调用 page_ref_inc 增加页面的引用计数。
    page_ref_inc(page);
  104821:	8b 45 0c             	mov    0xc(%ebp),%eax
  104824:	89 04 24             	mov    %eax,(%esp)
  104827:	e8 f7 f4 ff ff       	call   103d23 <page_ref_inc>
    //如果页表项已存在且指向当前页面，则减少页面引用计数。
    if (*ptep & PTE_P) {
  10482c:	8b 45 f4             	mov    -0xc(%ebp),%eax
  10482f:	8b 00                	mov    (%eax),%eax
  104831:	83 e0 01             	and    $0x1,%eax
  104834:	85 c0                	test   %eax,%eax
  104836:	74 3e                	je     104876 <page_insert+0x88>
        struct Page *p = pte2page(*ptep);
  104838:	8b 45 f4             	mov    -0xc(%ebp),%eax
  10483b:	8b 00                	mov    (%eax),%eax
  10483d:	89 04 24             	mov    %eax,(%esp)
  104840:	e8 6c f4 ff ff       	call   103cb1 <pte2page>
  104845:	89 45 f0             	mov    %eax,-0x10(%ebp)
        if (p == page) {
  104848:	8b 45 f0             	mov    -0x10(%ebp),%eax
  10484b:	3b 45 0c             	cmp    0xc(%ebp),%eax
  10484e:	75 0d                	jne    10485d <page_insert+0x6f>
            page_ref_dec(page);
  104850:	8b 45 0c             	mov    0xc(%ebp),%eax
  104853:	89 04 24             	mov    %eax,(%esp)
  104856:	e8 df f4 ff ff       	call   103d3a <page_ref_dec>
  10485b:	eb 19                	jmp    104876 <page_insert+0x88>
        }
        //如果页表项已存在但指向其他页面，则调用 page_remove_pte 移除旧的页表项。
        else {
            page_remove_pte(pgdir, la, ptep);
  10485d:	8b 45 f4             	mov    -0xc(%ebp),%eax
  104860:	89 44 24 08          	mov    %eax,0x8(%esp)
  104864:	8b 45 10             	mov    0x10(%ebp),%eax
  104867:	89 44 24 04          	mov    %eax,0x4(%esp)
  10486b:	8b 45 08             	mov    0x8(%ebp),%eax
  10486e:	89 04 24             	mov    %eax,(%esp)
  104871:	e8 cd fe ff ff       	call   104743 <page_remove_pte>
        }
    }
    *ptep = page2pa(page) | PTE_P | perm;
  104876:	8b 45 0c             	mov    0xc(%ebp),%eax
  104879:	89 04 24             	mov    %eax,(%esp)
  10487c:	e8 71 f3 ff ff       	call   103bf2 <page2pa>
  104881:	0b 45 14             	or     0x14(%ebp),%eax
  104884:	83 c8 01             	or     $0x1,%eax
  104887:	89 c2                	mov    %eax,%edx
  104889:	8b 45 f4             	mov    -0xc(%ebp),%eax
  10488c:	89 10                	mov    %edx,(%eax)
    tlb_invalidate(pgdir, la);//刷新 TLB
  10488e:	8b 45 10             	mov    0x10(%ebp),%eax
  104891:	89 44 24 04          	mov    %eax,0x4(%esp)
  104895:	8b 45 08             	mov    0x8(%ebp),%eax
  104898:	89 04 24             	mov    %eax,(%esp)
  10489b:	e8 09 00 00 00       	call   1048a9 <tlb_invalidate>
    return 0;
  1048a0:	b8 00 00 00 00       	mov    $0x0,%eax
}
  1048a5:	89 ec                	mov    %ebp,%esp
  1048a7:	5d                   	pop    %ebp
  1048a8:	c3                   	ret    

001048a9 <tlb_invalidate>:

// invalidate a TLB entry, but only if the page tables being
// edited are the ones currently in use by the processor.
//无效化指定地址的TLB条目
void
tlb_invalidate(pde_t *pgdir, uintptr_t la) {
  1048a9:	55                   	push   %ebp
  1048aa:	89 e5                	mov    %esp,%ebp
  1048ac:	83 ec 28             	sub    $0x28,%esp
}

static inline uintptr_t
rcr3(void) {
    uintptr_t cr3;
    asm volatile ("mov %%cr3, %0" : "=r" (cr3) :: "memory");
  1048af:	0f 20 d8             	mov    %cr3,%eax
  1048b2:	89 45 f0             	mov    %eax,-0x10(%ebp)
    return cr3;
  1048b5:	8b 55 f0             	mov    -0x10(%ebp),%edx
    //检查当前页目录地址是否与传入的页目录地址相同。
    if (rcr3() == PADDR(pgdir)) {
  1048b8:	8b 45 08             	mov    0x8(%ebp),%eax
  1048bb:	89 45 f4             	mov    %eax,-0xc(%ebp)
  1048be:	81 7d f4 ff ff ff bf 	cmpl   $0xbfffffff,-0xc(%ebp)
  1048c5:	77 23                	ja     1048ea <tlb_invalidate+0x41>
  1048c7:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1048ca:	89 44 24 0c          	mov    %eax,0xc(%esp)
  1048ce:	c7 44 24 08 50 6c 10 	movl   $0x106c50,0x8(%esp)
  1048d5:	00 
  1048d6:	c7 44 24 04 47 02 00 	movl   $0x247,0x4(%esp)
  1048dd:	00 
  1048de:	c7 04 24 74 6c 10 00 	movl   $0x106c74,(%esp)
  1048e5:	e8 49 c3 ff ff       	call   100c33 <__panic>
  1048ea:	8b 45 f4             	mov    -0xc(%ebp),%eax
  1048ed:	05 00 00 00 40       	add    $0x40000000,%eax
  1048f2:	39 d0                	cmp    %edx,%eax
  1048f4:	75 0d                	jne    104903 <tlb_invalidate+0x5a>
        //如果相同，则调用 invlpg 函数无效化指定线性地址的TLB条目。
        invlpg((void *)la);
  1048f6:	8b 45 0c             	mov    0xc(%ebp),%eax
  1048f9:	89 45 ec             	mov    %eax,-0x14(%ebp)
}

static inline void
invlpg(void *addr) {
    asm volatile ("invlpg (%0)" :: "r" (addr) : "memory");
  1048fc:	8b 45 ec             	mov    -0x14(%ebp),%eax
  1048ff:	0f 01 38             	invlpg (%eax)
}
  104902:	90                   	nop
    }
}
  104903:	90                   	nop
  104904:	89 ec                	mov    %ebp,%esp
  104906:	5d                   	pop    %ebp
  104907:	c3                   	ret    

00104908 <check_alloc_page>:

static void
check_alloc_page(void) {
  104908:	55                   	push   %ebp
  104909:	89 e5                	mov    %esp,%ebp
  10490b:	83 ec 18             	sub    $0x18,%esp
    //调用内存管理器的 check 方法，用于检查内存分配是否正常。
    pmm_manager->check();
  10490e:	a1 0c cf 11 00       	mov    0x11cf0c,%eax
  104913:	8b 40 18             	mov    0x18(%eax),%eax
  104916:	ff d0                	call   *%eax
    cprintf("check_alloc_page() succeeded!\n");
  104918:	c7 04 24 d4 6c 10 00 	movl   $0x106cd4,(%esp)
  10491f:	e8 42 ba ff ff       	call   100366 <cprintf>
}
  104924:	90                   	nop
  104925:	89 ec                	mov    %ebp,%esp
  104927:	5d                   	pop    %ebp
  104928:	c3                   	ret    

00104929 <check_pgdir>:
//用于验证页目录和页表的正确性。
static void
check_pgdir(void) {
  104929:	55                   	push   %ebp
  10492a:	89 e5                	mov    %esp,%ebp
  10492c:	83 ec 38             	sub    $0x38,%esp
    //确保内存页面数量在合理范围内
    assert(npage <= KMEMSIZE / PGSIZE);
  10492f:	a1 04 cf 11 00       	mov    0x11cf04,%eax
  104934:	3d 00 80 03 00       	cmp    $0x38000,%eax
  104939:	76 24                	jbe    10495f <check_pgdir+0x36>
  10493b:	c7 44 24 0c f3 6c 10 	movl   $0x106cf3,0xc(%esp)
  104942:	00 
  104943:	c7 44 24 08 99 6c 10 	movl   $0x106c99,0x8(%esp)
  10494a:	00 
  10494b:	c7 44 24 04 57 02 00 	movl   $0x257,0x4(%esp)
  104952:	00 
  104953:	c7 04 24 74 6c 10 00 	movl   $0x106c74,(%esp)
  10495a:	e8 d4 c2 ff ff       	call   100c33 <__panic>
    //确保页目录不为空且对齐，
    assert(boot_pgdir != NULL && (uint32_t)PGOFF(boot_pgdir) == 0);
  10495f:	a1 e0 99 11 00       	mov    0x1199e0,%eax
  104964:	85 c0                	test   %eax,%eax
  104966:	74 0e                	je     104976 <check_pgdir+0x4d>
  104968:	a1 e0 99 11 00       	mov    0x1199e0,%eax
  10496d:	25 ff 0f 00 00       	and    $0xfff,%eax
  104972:	85 c0                	test   %eax,%eax
  104974:	74 24                	je     10499a <check_pgdir+0x71>
  104976:	c7 44 24 0c 10 6d 10 	movl   $0x106d10,0xc(%esp)
  10497d:	00 
  10497e:	c7 44 24 08 99 6c 10 	movl   $0x106c99,0x8(%esp)
  104985:	00 
  104986:	c7 44 24 04 59 02 00 	movl   $0x259,0x4(%esp)
  10498d:	00 
  10498e:	c7 04 24 74 6c 10 00 	movl   $0x106c74,(%esp)
  104995:	e8 99 c2 ff ff       	call   100c33 <__panic>
    //确保虚拟地址 0x0 没有映射任何页面
    assert(get_page(boot_pgdir, 0x0, NULL) == NULL);
  10499a:	a1 e0 99 11 00       	mov    0x1199e0,%eax
  10499f:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  1049a6:	00 
  1049a7:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  1049ae:	00 
  1049af:	89 04 24             	mov    %eax,(%esp)
  1049b2:	e8 31 fd ff ff       	call   1046e8 <get_page>
  1049b7:	85 c0                	test   %eax,%eax
  1049b9:	74 24                	je     1049df <check_pgdir+0xb6>
  1049bb:	c7 44 24 0c 48 6d 10 	movl   $0x106d48,0xc(%esp)
  1049c2:	00 
  1049c3:	c7 44 24 08 99 6c 10 	movl   $0x106c99,0x8(%esp)
  1049ca:	00 
  1049cb:	c7 44 24 04 5b 02 00 	movl   $0x25b,0x4(%esp)
  1049d2:	00 
  1049d3:	c7 04 24 74 6c 10 00 	movl   $0x106c74,(%esp)
  1049da:	e8 54 c2 ff ff       	call   100c33 <__panic>
    
    //定义两个页面指针 p1 和 p2
    struct Page *p1, *p2;
    //分配一个页面 p1
    p1 = alloc_page();
  1049df:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  1049e6:	e8 30 f5 ff ff       	call   103f1b <alloc_pages>
  1049eb:	89 45 f4             	mov    %eax,-0xc(%ebp)
    //将 p1 插入到虚拟地址 0x0
    assert(page_insert(boot_pgdir, p1, 0x0, 0) == 0);
  1049ee:	a1 e0 99 11 00       	mov    0x1199e0,%eax
  1049f3:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
  1049fa:	00 
  1049fb:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  104a02:	00 
  104a03:	8b 55 f4             	mov    -0xc(%ebp),%edx
  104a06:	89 54 24 04          	mov    %edx,0x4(%esp)
  104a0a:	89 04 24             	mov    %eax,(%esp)
  104a0d:	e8 dc fd ff ff       	call   1047ee <page_insert>
  104a12:	85 c0                	test   %eax,%eax
  104a14:	74 24                	je     104a3a <check_pgdir+0x111>
  104a16:	c7 44 24 0c 70 6d 10 	movl   $0x106d70,0xc(%esp)
  104a1d:	00 
  104a1e:	c7 44 24 08 99 6c 10 	movl   $0x106c99,0x8(%esp)
  104a25:	00 
  104a26:	c7 44 24 04 62 02 00 	movl   $0x262,0x4(%esp)
  104a2d:	00 
  104a2e:	c7 04 24 74 6c 10 00 	movl   $0x106c74,(%esp)
  104a35:	e8 f9 c1 ff ff       	call   100c33 <__panic>

    // 获取虚拟地址 0x0 对应的页表项指针
    pte_t *ptep;
    assert((ptep = get_pte(boot_pgdir, 0x0, 0)) != NULL);
  104a3a:	a1 e0 99 11 00       	mov    0x1199e0,%eax
  104a3f:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  104a46:	00 
  104a47:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  104a4e:	00 
  104a4f:	89 04 24             	mov    %eax,(%esp)
  104a52:	e8 56 fb ff ff       	call   1045ad <get_pte>
  104a57:	89 45 f0             	mov    %eax,-0x10(%ebp)
  104a5a:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
  104a5e:	75 24                	jne    104a84 <check_pgdir+0x15b>
  104a60:	c7 44 24 0c 9c 6d 10 	movl   $0x106d9c,0xc(%esp)
  104a67:	00 
  104a68:	c7 44 24 08 99 6c 10 	movl   $0x106c99,0x8(%esp)
  104a6f:	00 
  104a70:	c7 44 24 04 66 02 00 	movl   $0x266,0x4(%esp)
  104a77:	00 
  104a78:	c7 04 24 74 6c 10 00 	movl   $0x106c74,(%esp)
  104a7f:	e8 af c1 ff ff       	call   100c33 <__panic>
    // 验证页表项对应的页面是 p1
    assert(pte2page(*ptep) == p1);
  104a84:	8b 45 f0             	mov    -0x10(%ebp),%eax
  104a87:	8b 00                	mov    (%eax),%eax
  104a89:	89 04 24             	mov    %eax,(%esp)
  104a8c:	e8 20 f2 ff ff       	call   103cb1 <pte2page>
  104a91:	39 45 f4             	cmp    %eax,-0xc(%ebp)
  104a94:	74 24                	je     104aba <check_pgdir+0x191>
  104a96:	c7 44 24 0c c9 6d 10 	movl   $0x106dc9,0xc(%esp)
  104a9d:	00 
  104a9e:	c7 44 24 08 99 6c 10 	movl   $0x106c99,0x8(%esp)
  104aa5:	00 
  104aa6:	c7 44 24 04 68 02 00 	movl   $0x268,0x4(%esp)
  104aad:	00 
  104aae:	c7 04 24 74 6c 10 00 	movl   $0x106c74,(%esp)
  104ab5:	e8 79 c1 ff ff       	call   100c33 <__panic>
    // 验证 p1 的引用计数为 1
    assert(page_ref(p1) == 1);
  104aba:	8b 45 f4             	mov    -0xc(%ebp),%eax
  104abd:	89 04 24             	mov    %eax,(%esp)
  104ac0:	e8 46 f2 ff ff       	call   103d0b <page_ref>
  104ac5:	83 f8 01             	cmp    $0x1,%eax
  104ac8:	74 24                	je     104aee <check_pgdir+0x1c5>
  104aca:	c7 44 24 0c df 6d 10 	movl   $0x106ddf,0xc(%esp)
  104ad1:	00 
  104ad2:	c7 44 24 08 99 6c 10 	movl   $0x106c99,0x8(%esp)
  104ad9:	00 
  104ada:	c7 44 24 04 6a 02 00 	movl   $0x26a,0x4(%esp)
  104ae1:	00 
  104ae2:	c7 04 24 74 6c 10 00 	movl   $0x106c74,(%esp)
  104ae9:	e8 45 c1 ff ff       	call   100c33 <__panic>
    // 获取虚拟地址 PGSIZE 对应的页表项指针
    ptep = &((pte_t *)KADDR(PDE_ADDR(boot_pgdir[0])))[1];
  104aee:	a1 e0 99 11 00       	mov    0x1199e0,%eax
  104af3:	8b 00                	mov    (%eax),%eax
  104af5:	25 00 f0 ff ff       	and    $0xfffff000,%eax
  104afa:	89 45 ec             	mov    %eax,-0x14(%ebp)
  104afd:	8b 45 ec             	mov    -0x14(%ebp),%eax
  104b00:	c1 e8 0c             	shr    $0xc,%eax
  104b03:	89 45 e8             	mov    %eax,-0x18(%ebp)
  104b06:	a1 04 cf 11 00       	mov    0x11cf04,%eax
  104b0b:	39 45 e8             	cmp    %eax,-0x18(%ebp)
  104b0e:	72 23                	jb     104b33 <check_pgdir+0x20a>
  104b10:	8b 45 ec             	mov    -0x14(%ebp),%eax
  104b13:	89 44 24 0c          	mov    %eax,0xc(%esp)
  104b17:	c7 44 24 08 ac 6b 10 	movl   $0x106bac,0x8(%esp)
  104b1e:	00 
  104b1f:	c7 44 24 04 6c 02 00 	movl   $0x26c,0x4(%esp)
  104b26:	00 
  104b27:	c7 04 24 74 6c 10 00 	movl   $0x106c74,(%esp)
  104b2e:	e8 00 c1 ff ff       	call   100c33 <__panic>
  104b33:	8b 45 ec             	mov    -0x14(%ebp),%eax
  104b36:	2d 00 00 00 40       	sub    $0x40000000,%eax
  104b3b:	83 c0 04             	add    $0x4,%eax
  104b3e:	89 45 f0             	mov    %eax,-0x10(%ebp)
    assert(get_pte(boot_pgdir, PGSIZE, 0) == ptep);
  104b41:	a1 e0 99 11 00       	mov    0x1199e0,%eax
  104b46:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  104b4d:	00 
  104b4e:	c7 44 24 04 00 10 00 	movl   $0x1000,0x4(%esp)
  104b55:	00 
  104b56:	89 04 24             	mov    %eax,(%esp)
  104b59:	e8 4f fa ff ff       	call   1045ad <get_pte>
  104b5e:	39 45 f0             	cmp    %eax,-0x10(%ebp)
  104b61:	74 24                	je     104b87 <check_pgdir+0x25e>
  104b63:	c7 44 24 0c f4 6d 10 	movl   $0x106df4,0xc(%esp)
  104b6a:	00 
  104b6b:	c7 44 24 08 99 6c 10 	movl   $0x106c99,0x8(%esp)
  104b72:	00 
  104b73:	c7 44 24 04 6d 02 00 	movl   $0x26d,0x4(%esp)
  104b7a:	00 
  104b7b:	c7 04 24 74 6c 10 00 	movl   $0x106c74,(%esp)
  104b82:	e8 ac c0 ff ff       	call   100c33 <__panic>
    // 分配一个页面 p2
    p2 = alloc_page();
  104b87:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  104b8e:	e8 88 f3 ff ff       	call   103f1b <alloc_pages>
  104b93:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    // 将 p2 插入到虚拟地址 PGSIZE，并设置用户和写权限
    assert(page_insert(boot_pgdir, p2, PGSIZE, PTE_U | PTE_W) == 0);
  104b96:	a1 e0 99 11 00       	mov    0x1199e0,%eax
  104b9b:	c7 44 24 0c 06 00 00 	movl   $0x6,0xc(%esp)
  104ba2:	00 
  104ba3:	c7 44 24 08 00 10 00 	movl   $0x1000,0x8(%esp)
  104baa:	00 
  104bab:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  104bae:	89 54 24 04          	mov    %edx,0x4(%esp)
  104bb2:	89 04 24             	mov    %eax,(%esp)
  104bb5:	e8 34 fc ff ff       	call   1047ee <page_insert>
  104bba:	85 c0                	test   %eax,%eax
  104bbc:	74 24                	je     104be2 <check_pgdir+0x2b9>
  104bbe:	c7 44 24 0c 1c 6e 10 	movl   $0x106e1c,0xc(%esp)
  104bc5:	00 
  104bc6:	c7 44 24 08 99 6c 10 	movl   $0x106c99,0x8(%esp)
  104bcd:	00 
  104bce:	c7 44 24 04 71 02 00 	movl   $0x271,0x4(%esp)
  104bd5:	00 
  104bd6:	c7 04 24 74 6c 10 00 	movl   $0x106c74,(%esp)
  104bdd:	e8 51 c0 ff ff       	call   100c33 <__panic>
    // 获取虚拟地址 PGSIZE 对应的页表项指针
    assert((ptep = get_pte(boot_pgdir, PGSIZE, 0)) != NULL);
  104be2:	a1 e0 99 11 00       	mov    0x1199e0,%eax
  104be7:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  104bee:	00 
  104bef:	c7 44 24 04 00 10 00 	movl   $0x1000,0x4(%esp)
  104bf6:	00 
  104bf7:	89 04 24             	mov    %eax,(%esp)
  104bfa:	e8 ae f9 ff ff       	call   1045ad <get_pte>
  104bff:	89 45 f0             	mov    %eax,-0x10(%ebp)
  104c02:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
  104c06:	75 24                	jne    104c2c <check_pgdir+0x303>
  104c08:	c7 44 24 0c 54 6e 10 	movl   $0x106e54,0xc(%esp)
  104c0f:	00 
  104c10:	c7 44 24 08 99 6c 10 	movl   $0x106c99,0x8(%esp)
  104c17:	00 
  104c18:	c7 44 24 04 73 02 00 	movl   $0x273,0x4(%esp)
  104c1f:	00 
  104c20:	c7 04 24 74 6c 10 00 	movl   $0x106c74,(%esp)
  104c27:	e8 07 c0 ff ff       	call   100c33 <__panic>
    // 验证页表项设置了用户权限
    assert(*ptep & PTE_U);
  104c2c:	8b 45 f0             	mov    -0x10(%ebp),%eax
  104c2f:	8b 00                	mov    (%eax),%eax
  104c31:	83 e0 04             	and    $0x4,%eax
  104c34:	85 c0                	test   %eax,%eax
  104c36:	75 24                	jne    104c5c <check_pgdir+0x333>
  104c38:	c7 44 24 0c 84 6e 10 	movl   $0x106e84,0xc(%esp)
  104c3f:	00 
  104c40:	c7 44 24 08 99 6c 10 	movl   $0x106c99,0x8(%esp)
  104c47:	00 
  104c48:	c7 44 24 04 75 02 00 	movl   $0x275,0x4(%esp)
  104c4f:	00 
  104c50:	c7 04 24 74 6c 10 00 	movl   $0x106c74,(%esp)
  104c57:	e8 d7 bf ff ff       	call   100c33 <__panic>
    // 验证页表项设置了写权限
    assert(*ptep & PTE_W);
  104c5c:	8b 45 f0             	mov    -0x10(%ebp),%eax
  104c5f:	8b 00                	mov    (%eax),%eax
  104c61:	83 e0 02             	and    $0x2,%eax
  104c64:	85 c0                	test   %eax,%eax
  104c66:	75 24                	jne    104c8c <check_pgdir+0x363>
  104c68:	c7 44 24 0c 92 6e 10 	movl   $0x106e92,0xc(%esp)
  104c6f:	00 
  104c70:	c7 44 24 08 99 6c 10 	movl   $0x106c99,0x8(%esp)
  104c77:	00 
  104c78:	c7 44 24 04 77 02 00 	movl   $0x277,0x4(%esp)
  104c7f:	00 
  104c80:	c7 04 24 74 6c 10 00 	movl   $0x106c74,(%esp)
  104c87:	e8 a7 bf ff ff       	call   100c33 <__panic>
    // 验证页目录项设置了用户权限
    assert(boot_pgdir[0] & PTE_U);
  104c8c:	a1 e0 99 11 00       	mov    0x1199e0,%eax
  104c91:	8b 00                	mov    (%eax),%eax
  104c93:	83 e0 04             	and    $0x4,%eax
  104c96:	85 c0                	test   %eax,%eax
  104c98:	75 24                	jne    104cbe <check_pgdir+0x395>
  104c9a:	c7 44 24 0c a0 6e 10 	movl   $0x106ea0,0xc(%esp)
  104ca1:	00 
  104ca2:	c7 44 24 08 99 6c 10 	movl   $0x106c99,0x8(%esp)
  104ca9:	00 
  104caa:	c7 44 24 04 79 02 00 	movl   $0x279,0x4(%esp)
  104cb1:	00 
  104cb2:	c7 04 24 74 6c 10 00 	movl   $0x106c74,(%esp)
  104cb9:	e8 75 bf ff ff       	call   100c33 <__panic>
    // 验证 p2 的引用计数为 1
    assert(page_ref(p2) == 1);
  104cbe:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  104cc1:	89 04 24             	mov    %eax,(%esp)
  104cc4:	e8 42 f0 ff ff       	call   103d0b <page_ref>
  104cc9:	83 f8 01             	cmp    $0x1,%eax
  104ccc:	74 24                	je     104cf2 <check_pgdir+0x3c9>
  104cce:	c7 44 24 0c b6 6e 10 	movl   $0x106eb6,0xc(%esp)
  104cd5:	00 
  104cd6:	c7 44 24 08 99 6c 10 	movl   $0x106c99,0x8(%esp)
  104cdd:	00 
  104cde:	c7 44 24 04 7b 02 00 	movl   $0x27b,0x4(%esp)
  104ce5:	00 
  104ce6:	c7 04 24 74 6c 10 00 	movl   $0x106c74,(%esp)
  104ced:	e8 41 bf ff ff       	call   100c33 <__panic>

    // 将 p1 插入到虚拟地址 PGSIZE，替换掉 p2
    assert(page_insert(boot_pgdir, p1, PGSIZE, 0) == 0);
  104cf2:	a1 e0 99 11 00       	mov    0x1199e0,%eax
  104cf7:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
  104cfe:	00 
  104cff:	c7 44 24 08 00 10 00 	movl   $0x1000,0x8(%esp)
  104d06:	00 
  104d07:	8b 55 f4             	mov    -0xc(%ebp),%edx
  104d0a:	89 54 24 04          	mov    %edx,0x4(%esp)
  104d0e:	89 04 24             	mov    %eax,(%esp)
  104d11:	e8 d8 fa ff ff       	call   1047ee <page_insert>
  104d16:	85 c0                	test   %eax,%eax
  104d18:	74 24                	je     104d3e <check_pgdir+0x415>
  104d1a:	c7 44 24 0c c8 6e 10 	movl   $0x106ec8,0xc(%esp)
  104d21:	00 
  104d22:	c7 44 24 08 99 6c 10 	movl   $0x106c99,0x8(%esp)
  104d29:	00 
  104d2a:	c7 44 24 04 7e 02 00 	movl   $0x27e,0x4(%esp)
  104d31:	00 
  104d32:	c7 04 24 74 6c 10 00 	movl   $0x106c74,(%esp)
  104d39:	e8 f5 be ff ff       	call   100c33 <__panic>
    // 验证 p1 的引用计数增加到 2
    assert(page_ref(p1) == 2);
  104d3e:	8b 45 f4             	mov    -0xc(%ebp),%eax
  104d41:	89 04 24             	mov    %eax,(%esp)
  104d44:	e8 c2 ef ff ff       	call   103d0b <page_ref>
  104d49:	83 f8 02             	cmp    $0x2,%eax
  104d4c:	74 24                	je     104d72 <check_pgdir+0x449>
  104d4e:	c7 44 24 0c f4 6e 10 	movl   $0x106ef4,0xc(%esp)
  104d55:	00 
  104d56:	c7 44 24 08 99 6c 10 	movl   $0x106c99,0x8(%esp)
  104d5d:	00 
  104d5e:	c7 44 24 04 80 02 00 	movl   $0x280,0x4(%esp)
  104d65:	00 
  104d66:	c7 04 24 74 6c 10 00 	movl   $0x106c74,(%esp)
  104d6d:	e8 c1 be ff ff       	call   100c33 <__panic>
    // 验证 p2 的引用计数减少到 0
    assert(page_ref(p2) == 0);
  104d72:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  104d75:	89 04 24             	mov    %eax,(%esp)
  104d78:	e8 8e ef ff ff       	call   103d0b <page_ref>
  104d7d:	85 c0                	test   %eax,%eax
  104d7f:	74 24                	je     104da5 <check_pgdir+0x47c>
  104d81:	c7 44 24 0c 06 6f 10 	movl   $0x106f06,0xc(%esp)
  104d88:	00 
  104d89:	c7 44 24 08 99 6c 10 	movl   $0x106c99,0x8(%esp)
  104d90:	00 
  104d91:	c7 44 24 04 82 02 00 	movl   $0x282,0x4(%esp)
  104d98:	00 
  104d99:	c7 04 24 74 6c 10 00 	movl   $0x106c74,(%esp)
  104da0:	e8 8e be ff ff       	call   100c33 <__panic>
     // 获取虚拟地址 PGSIZE 对应的页表项指针
    assert((ptep = get_pte(boot_pgdir, PGSIZE, 0)) != NULL);
  104da5:	a1 e0 99 11 00       	mov    0x1199e0,%eax
  104daa:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  104db1:	00 
  104db2:	c7 44 24 04 00 10 00 	movl   $0x1000,0x4(%esp)
  104db9:	00 
  104dba:	89 04 24             	mov    %eax,(%esp)
  104dbd:	e8 eb f7 ff ff       	call   1045ad <get_pte>
  104dc2:	89 45 f0             	mov    %eax,-0x10(%ebp)
  104dc5:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
  104dc9:	75 24                	jne    104def <check_pgdir+0x4c6>
  104dcb:	c7 44 24 0c 54 6e 10 	movl   $0x106e54,0xc(%esp)
  104dd2:	00 
  104dd3:	c7 44 24 08 99 6c 10 	movl   $0x106c99,0x8(%esp)
  104dda:	00 
  104ddb:	c7 44 24 04 84 02 00 	movl   $0x284,0x4(%esp)
  104de2:	00 
  104de3:	c7 04 24 74 6c 10 00 	movl   $0x106c74,(%esp)
  104dea:	e8 44 be ff ff       	call   100c33 <__panic>
    // 验证页表项对应的页面是 p1
    assert(pte2page(*ptep) == p1);
  104def:	8b 45 f0             	mov    -0x10(%ebp),%eax
  104df2:	8b 00                	mov    (%eax),%eax
  104df4:	89 04 24             	mov    %eax,(%esp)
  104df7:	e8 b5 ee ff ff       	call   103cb1 <pte2page>
  104dfc:	39 45 f4             	cmp    %eax,-0xc(%ebp)
  104dff:	74 24                	je     104e25 <check_pgdir+0x4fc>
  104e01:	c7 44 24 0c c9 6d 10 	movl   $0x106dc9,0xc(%esp)
  104e08:	00 
  104e09:	c7 44 24 08 99 6c 10 	movl   $0x106c99,0x8(%esp)
  104e10:	00 
  104e11:	c7 44 24 04 86 02 00 	movl   $0x286,0x4(%esp)
  104e18:	00 
  104e19:	c7 04 24 74 6c 10 00 	movl   $0x106c74,(%esp)
  104e20:	e8 0e be ff ff       	call   100c33 <__panic>
     // 验证页表项没有设置用户权限
    assert((*ptep & PTE_U) == 0);
  104e25:	8b 45 f0             	mov    -0x10(%ebp),%eax
  104e28:	8b 00                	mov    (%eax),%eax
  104e2a:	83 e0 04             	and    $0x4,%eax
  104e2d:	85 c0                	test   %eax,%eax
  104e2f:	74 24                	je     104e55 <check_pgdir+0x52c>
  104e31:	c7 44 24 0c 18 6f 10 	movl   $0x106f18,0xc(%esp)
  104e38:	00 
  104e39:	c7 44 24 08 99 6c 10 	movl   $0x106c99,0x8(%esp)
  104e40:	00 
  104e41:	c7 44 24 04 88 02 00 	movl   $0x288,0x4(%esp)
  104e48:	00 
  104e49:	c7 04 24 74 6c 10 00 	movl   $0x106c74,(%esp)
  104e50:	e8 de bd ff ff       	call   100c33 <__panic>
    
    //移除虚拟地址 0x0 的映射，
    page_remove(boot_pgdir, 0x0);
  104e55:	a1 e0 99 11 00       	mov    0x1199e0,%eax
  104e5a:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  104e61:	00 
  104e62:	89 04 24             	mov    %eax,(%esp)
  104e65:	e8 3d f9 ff ff       	call   1047a7 <page_remove>
    //验证 p1 的引用计数减少到 1。
    assert(page_ref(p1) == 1);
  104e6a:	8b 45 f4             	mov    -0xc(%ebp),%eax
  104e6d:	89 04 24             	mov    %eax,(%esp)
  104e70:	e8 96 ee ff ff       	call   103d0b <page_ref>
  104e75:	83 f8 01             	cmp    $0x1,%eax
  104e78:	74 24                	je     104e9e <check_pgdir+0x575>
  104e7a:	c7 44 24 0c df 6d 10 	movl   $0x106ddf,0xc(%esp)
  104e81:	00 
  104e82:	c7 44 24 08 99 6c 10 	movl   $0x106c99,0x8(%esp)
  104e89:	00 
  104e8a:	c7 44 24 04 8d 02 00 	movl   $0x28d,0x4(%esp)
  104e91:	00 
  104e92:	c7 04 24 74 6c 10 00 	movl   $0x106c74,(%esp)
  104e99:	e8 95 bd ff ff       	call   100c33 <__panic>
    //验证 p2 的引用计数减少到 0
    assert(page_ref(p2) == 0);
  104e9e:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  104ea1:	89 04 24             	mov    %eax,(%esp)
  104ea4:	e8 62 ee ff ff       	call   103d0b <page_ref>
  104ea9:	85 c0                	test   %eax,%eax
  104eab:	74 24                	je     104ed1 <check_pgdir+0x5a8>
  104ead:	c7 44 24 0c 06 6f 10 	movl   $0x106f06,0xc(%esp)
  104eb4:	00 
  104eb5:	c7 44 24 08 99 6c 10 	movl   $0x106c99,0x8(%esp)
  104ebc:	00 
  104ebd:	c7 44 24 04 8f 02 00 	movl   $0x28f,0x4(%esp)
  104ec4:	00 
  104ec5:	c7 04 24 74 6c 10 00 	movl   $0x106c74,(%esp)
  104ecc:	e8 62 bd ff ff       	call   100c33 <__panic>

    //移除虚拟地址 PGSIZE 的映射，
    page_remove(boot_pgdir, PGSIZE);
  104ed1:	a1 e0 99 11 00       	mov    0x1199e0,%eax
  104ed6:	c7 44 24 04 00 10 00 	movl   $0x1000,0x4(%esp)
  104edd:	00 
  104ede:	89 04 24             	mov    %eax,(%esp)
  104ee1:	e8 c1 f8 ff ff       	call   1047a7 <page_remove>
    //验证 p1 的引用计数减少到 0
    assert(page_ref(p1) == 0);
  104ee6:	8b 45 f4             	mov    -0xc(%ebp),%eax
  104ee9:	89 04 24             	mov    %eax,(%esp)
  104eec:	e8 1a ee ff ff       	call   103d0b <page_ref>
  104ef1:	85 c0                	test   %eax,%eax
  104ef3:	74 24                	je     104f19 <check_pgdir+0x5f0>
  104ef5:	c7 44 24 0c 2d 6f 10 	movl   $0x106f2d,0xc(%esp)
  104efc:	00 
  104efd:	c7 44 24 08 99 6c 10 	movl   $0x106c99,0x8(%esp)
  104f04:	00 
  104f05:	c7 44 24 04 94 02 00 	movl   $0x294,0x4(%esp)
  104f0c:	00 
  104f0d:	c7 04 24 74 6c 10 00 	movl   $0x106c74,(%esp)
  104f14:	e8 1a bd ff ff       	call   100c33 <__panic>
    //验证 p2 的引用计数减少到 0
    assert(page_ref(p2) == 0);
  104f19:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  104f1c:	89 04 24             	mov    %eax,(%esp)
  104f1f:	e8 e7 ed ff ff       	call   103d0b <page_ref>
  104f24:	85 c0                	test   %eax,%eax
  104f26:	74 24                	je     104f4c <check_pgdir+0x623>
  104f28:	c7 44 24 0c 06 6f 10 	movl   $0x106f06,0xc(%esp)
  104f2f:	00 
  104f30:	c7 44 24 08 99 6c 10 	movl   $0x106c99,0x8(%esp)
  104f37:	00 
  104f38:	c7 44 24 04 96 02 00 	movl   $0x296,0x4(%esp)
  104f3f:	00 
  104f40:	c7 04 24 74 6c 10 00 	movl   $0x106c74,(%esp)
  104f47:	e8 e7 bc ff ff       	call   100c33 <__panic>
    
    //验证页目录的第一页表的引用计数为 1。
    assert(page_ref(pde2page(boot_pgdir[0])) == 1);
  104f4c:	a1 e0 99 11 00       	mov    0x1199e0,%eax
  104f51:	8b 00                	mov    (%eax),%eax
  104f53:	89 04 24             	mov    %eax,(%esp)
  104f56:	e8 96 ed ff ff       	call   103cf1 <pde2page>
  104f5b:	89 04 24             	mov    %eax,(%esp)
  104f5e:	e8 a8 ed ff ff       	call   103d0b <page_ref>
  104f63:	83 f8 01             	cmp    $0x1,%eax
  104f66:	74 24                	je     104f8c <check_pgdir+0x663>
  104f68:	c7 44 24 0c 40 6f 10 	movl   $0x106f40,0xc(%esp)
  104f6f:	00 
  104f70:	c7 44 24 08 99 6c 10 	movl   $0x106c99,0x8(%esp)
  104f77:	00 
  104f78:	c7 44 24 04 99 02 00 	movl   $0x299,0x4(%esp)
  104f7f:	00 
  104f80:	c7 04 24 74 6c 10 00 	movl   $0x106c74,(%esp)
  104f87:	e8 a7 bc ff ff       	call   100c33 <__panic>
    //释放页目录的第一页表
    free_page(pde2page(boot_pgdir[0]));
  104f8c:	a1 e0 99 11 00       	mov    0x1199e0,%eax
  104f91:	8b 00                	mov    (%eax),%eax
  104f93:	89 04 24             	mov    %eax,(%esp)
  104f96:	e8 56 ed ff ff       	call   103cf1 <pde2page>
  104f9b:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  104fa2:	00 
  104fa3:	89 04 24             	mov    %eax,(%esp)
  104fa6:	e8 aa ef ff ff       	call   103f55 <free_pages>
    //清空页目录的第一页表
    boot_pgdir[0] = 0;
  104fab:	a1 e0 99 11 00       	mov    0x1199e0,%eax
  104fb0:	c7 00 00 00 00 00    	movl   $0x0,(%eax)

    cprintf("check_pgdir() succeeded!\n");
  104fb6:	c7 04 24 67 6f 10 00 	movl   $0x106f67,(%esp)
  104fbd:	e8 a4 b3 ff ff       	call   100366 <cprintf>
}
  104fc2:	90                   	nop
  104fc3:	89 ec                	mov    %ebp,%esp
  104fc5:	5d                   	pop    %ebp
  104fc6:	c3                   	ret    

00104fc7 <check_boot_pgdir>:

//检查内核页表 boot_pgdir 的正确性
static void
check_boot_pgdir(void) {
  104fc7:	55                   	push   %ebp
  104fc8:	89 e5                	mov    %esp,%ebp
  104fca:	83 ec 38             	sub    $0x38,%esp
    pte_t *ptep;// 定义一个指向页表项的指针
    int i;
    for (i = 0; i < npage; i += PGSIZE) {// 遍历所有页面
  104fcd:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
  104fd4:	e9 ca 00 00 00       	jmp    1050a3 <check_boot_pgdir+0xdc>
        // 获取第 i 个页面的页表项，并确保其不为空
        assert((ptep = get_pte(boot_pgdir, (uintptr_t)KADDR(i), 0)) != NULL);
  104fd9:	8b 45 f4             	mov    -0xc(%ebp),%eax
  104fdc:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  104fdf:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  104fe2:	c1 e8 0c             	shr    $0xc,%eax
  104fe5:	89 45 e0             	mov    %eax,-0x20(%ebp)
  104fe8:	a1 04 cf 11 00       	mov    0x11cf04,%eax
  104fed:	39 45 e0             	cmp    %eax,-0x20(%ebp)
  104ff0:	72 23                	jb     105015 <check_boot_pgdir+0x4e>
  104ff2:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  104ff5:	89 44 24 0c          	mov    %eax,0xc(%esp)
  104ff9:	c7 44 24 08 ac 6b 10 	movl   $0x106bac,0x8(%esp)
  105000:	00 
  105001:	c7 44 24 04 a9 02 00 	movl   $0x2a9,0x4(%esp)
  105008:	00 
  105009:	c7 04 24 74 6c 10 00 	movl   $0x106c74,(%esp)
  105010:	e8 1e bc ff ff       	call   100c33 <__panic>
  105015:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  105018:	2d 00 00 00 40       	sub    $0x40000000,%eax
  10501d:	89 c2                	mov    %eax,%edx
  10501f:	a1 e0 99 11 00       	mov    0x1199e0,%eax
  105024:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  10502b:	00 
  10502c:	89 54 24 04          	mov    %edx,0x4(%esp)
  105030:	89 04 24             	mov    %eax,(%esp)
  105033:	e8 75 f5 ff ff       	call   1045ad <get_pte>
  105038:	89 45 dc             	mov    %eax,-0x24(%ebp)
  10503b:	83 7d dc 00          	cmpl   $0x0,-0x24(%ebp)
  10503f:	75 24                	jne    105065 <check_boot_pgdir+0x9e>
  105041:	c7 44 24 0c 84 6f 10 	movl   $0x106f84,0xc(%esp)
  105048:	00 
  105049:	c7 44 24 08 99 6c 10 	movl   $0x106c99,0x8(%esp)
  105050:	00 
  105051:	c7 44 24 04 a9 02 00 	movl   $0x2a9,0x4(%esp)
  105058:	00 
  105059:	c7 04 24 74 6c 10 00 	movl   $0x106c74,(%esp)
  105060:	e8 ce bb ff ff       	call   100c33 <__panic>
        // 验证页表项的物理地址是否正确
        assert(PTE_ADDR(*ptep) == i);
  105065:	8b 45 dc             	mov    -0x24(%ebp),%eax
  105068:	8b 00                	mov    (%eax),%eax
  10506a:	25 00 f0 ff ff       	and    $0xfffff000,%eax
  10506f:	89 c2                	mov    %eax,%edx
  105071:	8b 45 f4             	mov    -0xc(%ebp),%eax
  105074:	39 c2                	cmp    %eax,%edx
  105076:	74 24                	je     10509c <check_boot_pgdir+0xd5>
  105078:	c7 44 24 0c c1 6f 10 	movl   $0x106fc1,0xc(%esp)
  10507f:	00 
  105080:	c7 44 24 08 99 6c 10 	movl   $0x106c99,0x8(%esp)
  105087:	00 
  105088:	c7 44 24 04 ab 02 00 	movl   $0x2ab,0x4(%esp)
  10508f:	00 
  105090:	c7 04 24 74 6c 10 00 	movl   $0x106c74,(%esp)
  105097:	e8 97 bb ff ff       	call   100c33 <__panic>
    for (i = 0; i < npage; i += PGSIZE) {// 遍历所有页面
  10509c:	81 45 f4 00 10 00 00 	addl   $0x1000,-0xc(%ebp)
  1050a3:	8b 55 f4             	mov    -0xc(%ebp),%edx
  1050a6:	a1 04 cf 11 00       	mov    0x11cf04,%eax
  1050ab:	39 c2                	cmp    %eax,%edx
  1050ad:	0f 82 26 ff ff ff    	jb     104fd9 <check_boot_pgdir+0x12>
    }
    // 验证页目录项的物理地址是否正确
    assert(PDE_ADDR(boot_pgdir[PDX(VPT)]) == PADDR(boot_pgdir));
  1050b3:	a1 e0 99 11 00       	mov    0x1199e0,%eax
  1050b8:	05 ac 0f 00 00       	add    $0xfac,%eax
  1050bd:	8b 00                	mov    (%eax),%eax
  1050bf:	25 00 f0 ff ff       	and    $0xfffff000,%eax
  1050c4:	89 c2                	mov    %eax,%edx
  1050c6:	a1 e0 99 11 00       	mov    0x1199e0,%eax
  1050cb:	89 45 f0             	mov    %eax,-0x10(%ebp)
  1050ce:	81 7d f0 ff ff ff bf 	cmpl   $0xbfffffff,-0x10(%ebp)
  1050d5:	77 23                	ja     1050fa <check_boot_pgdir+0x133>
  1050d7:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1050da:	89 44 24 0c          	mov    %eax,0xc(%esp)
  1050de:	c7 44 24 08 50 6c 10 	movl   $0x106c50,0x8(%esp)
  1050e5:	00 
  1050e6:	c7 44 24 04 ae 02 00 	movl   $0x2ae,0x4(%esp)
  1050ed:	00 
  1050ee:	c7 04 24 74 6c 10 00 	movl   $0x106c74,(%esp)
  1050f5:	e8 39 bb ff ff       	call   100c33 <__panic>
  1050fa:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1050fd:	05 00 00 00 40       	add    $0x40000000,%eax
  105102:	39 d0                	cmp    %edx,%eax
  105104:	74 24                	je     10512a <check_boot_pgdir+0x163>
  105106:	c7 44 24 0c d8 6f 10 	movl   $0x106fd8,0xc(%esp)
  10510d:	00 
  10510e:	c7 44 24 08 99 6c 10 	movl   $0x106c99,0x8(%esp)
  105115:	00 
  105116:	c7 44 24 04 ae 02 00 	movl   $0x2ae,0x4(%esp)
  10511d:	00 
  10511e:	c7 04 24 74 6c 10 00 	movl   $0x106c74,(%esp)
  105125:	e8 09 bb ff ff       	call   100c33 <__panic>

    assert(boot_pgdir[0] == 0);// 确保页目录的第一个项为0
  10512a:	a1 e0 99 11 00       	mov    0x1199e0,%eax
  10512f:	8b 00                	mov    (%eax),%eax
  105131:	85 c0                	test   %eax,%eax
  105133:	74 24                	je     105159 <check_boot_pgdir+0x192>
  105135:	c7 44 24 0c 0c 70 10 	movl   $0x10700c,0xc(%esp)
  10513c:	00 
  10513d:	c7 44 24 08 99 6c 10 	movl   $0x106c99,0x8(%esp)
  105144:	00 
  105145:	c7 44 24 04 b0 02 00 	movl   $0x2b0,0x4(%esp)
  10514c:	00 
  10514d:	c7 04 24 74 6c 10 00 	movl   $0x106c74,(%esp)
  105154:	e8 da ba ff ff       	call   100c33 <__panic>

    struct Page *p;// 定义一个指向页面的指针
    p = alloc_page();// 分配一个页面
  105159:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  105160:	e8 b6 ed ff ff       	call   103f1b <alloc_pages>
  105165:	89 45 ec             	mov    %eax,-0x14(%ebp)
    // 将页面插入到虚拟地址 0x100，并确保操作成功
    assert(page_insert(boot_pgdir, p, 0x100, PTE_W) == 0);
  105168:	a1 e0 99 11 00       	mov    0x1199e0,%eax
  10516d:	c7 44 24 0c 02 00 00 	movl   $0x2,0xc(%esp)
  105174:	00 
  105175:	c7 44 24 08 00 01 00 	movl   $0x100,0x8(%esp)
  10517c:	00 
  10517d:	8b 55 ec             	mov    -0x14(%ebp),%edx
  105180:	89 54 24 04          	mov    %edx,0x4(%esp)
  105184:	89 04 24             	mov    %eax,(%esp)
  105187:	e8 62 f6 ff ff       	call   1047ee <page_insert>
  10518c:	85 c0                	test   %eax,%eax
  10518e:	74 24                	je     1051b4 <check_boot_pgdir+0x1ed>
  105190:	c7 44 24 0c 20 70 10 	movl   $0x107020,0xc(%esp)
  105197:	00 
  105198:	c7 44 24 08 99 6c 10 	movl   $0x106c99,0x8(%esp)
  10519f:	00 
  1051a0:	c7 44 24 04 b5 02 00 	movl   $0x2b5,0x4(%esp)
  1051a7:	00 
  1051a8:	c7 04 24 74 6c 10 00 	movl   $0x106c74,(%esp)
  1051af:	e8 7f ba ff ff       	call   100c33 <__panic>
    assert(page_ref(p) == 1);// 验证页面的引用计数为1
  1051b4:	8b 45 ec             	mov    -0x14(%ebp),%eax
  1051b7:	89 04 24             	mov    %eax,(%esp)
  1051ba:	e8 4c eb ff ff       	call   103d0b <page_ref>
  1051bf:	83 f8 01             	cmp    $0x1,%eax
  1051c2:	74 24                	je     1051e8 <check_boot_pgdir+0x221>
  1051c4:	c7 44 24 0c 4e 70 10 	movl   $0x10704e,0xc(%esp)
  1051cb:	00 
  1051cc:	c7 44 24 08 99 6c 10 	movl   $0x106c99,0x8(%esp)
  1051d3:	00 
  1051d4:	c7 44 24 04 b6 02 00 	movl   $0x2b6,0x4(%esp)
  1051db:	00 
  1051dc:	c7 04 24 74 6c 10 00 	movl   $0x106c74,(%esp)
  1051e3:	e8 4b ba ff ff       	call   100c33 <__panic>
    // 将页面插入到虚拟地址 0x100 + PGSIZE，并确保操作成功
    assert(page_insert(boot_pgdir, p, 0x100 + PGSIZE, PTE_W) == 0);
  1051e8:	a1 e0 99 11 00       	mov    0x1199e0,%eax
  1051ed:	c7 44 24 0c 02 00 00 	movl   $0x2,0xc(%esp)
  1051f4:	00 
  1051f5:	c7 44 24 08 00 11 00 	movl   $0x1100,0x8(%esp)
  1051fc:	00 
  1051fd:	8b 55 ec             	mov    -0x14(%ebp),%edx
  105200:	89 54 24 04          	mov    %edx,0x4(%esp)
  105204:	89 04 24             	mov    %eax,(%esp)
  105207:	e8 e2 f5 ff ff       	call   1047ee <page_insert>
  10520c:	85 c0                	test   %eax,%eax
  10520e:	74 24                	je     105234 <check_boot_pgdir+0x26d>
  105210:	c7 44 24 0c 60 70 10 	movl   $0x107060,0xc(%esp)
  105217:	00 
  105218:	c7 44 24 08 99 6c 10 	movl   $0x106c99,0x8(%esp)
  10521f:	00 
  105220:	c7 44 24 04 b8 02 00 	movl   $0x2b8,0x4(%esp)
  105227:	00 
  105228:	c7 04 24 74 6c 10 00 	movl   $0x106c74,(%esp)
  10522f:	e8 ff b9 ff ff       	call   100c33 <__panic>
    assert(page_ref(p) == 2);// 验证页面的引用计数为2
  105234:	8b 45 ec             	mov    -0x14(%ebp),%eax
  105237:	89 04 24             	mov    %eax,(%esp)
  10523a:	e8 cc ea ff ff       	call   103d0b <page_ref>
  10523f:	83 f8 02             	cmp    $0x2,%eax
  105242:	74 24                	je     105268 <check_boot_pgdir+0x2a1>
  105244:	c7 44 24 0c 97 70 10 	movl   $0x107097,0xc(%esp)
  10524b:	00 
  10524c:	c7 44 24 08 99 6c 10 	movl   $0x106c99,0x8(%esp)
  105253:	00 
  105254:	c7 44 24 04 b9 02 00 	movl   $0x2b9,0x4(%esp)
  10525b:	00 
  10525c:	c7 04 24 74 6c 10 00 	movl   $0x106c74,(%esp)
  105263:	e8 cb b9 ff ff       	call   100c33 <__panic>

    const char *str = "ucore: Hello world!!";// 定义一个字符串
  105268:	c7 45 e8 a8 70 10 00 	movl   $0x1070a8,-0x18(%ebp)
    strcpy((void *)0x100, str);// 将字符串复制到虚拟地址 0x100
  10526f:	8b 45 e8             	mov    -0x18(%ebp),%eax
  105272:	89 44 24 04          	mov    %eax,0x4(%esp)
  105276:	c7 04 24 00 01 00 00 	movl   $0x100,(%esp)
  10527d:	e8 fc 09 00 00       	call   105c7e <strcpy>
    // 验证两个映射地址的数据是否一致
    assert(strcmp((void *)0x100, (void *)(0x100 + PGSIZE)) == 0);
  105282:	c7 44 24 04 00 11 00 	movl   $0x1100,0x4(%esp)
  105289:	00 
  10528a:	c7 04 24 00 01 00 00 	movl   $0x100,(%esp)
  105291:	e8 60 0a 00 00       	call   105cf6 <strcmp>
  105296:	85 c0                	test   %eax,%eax
  105298:	74 24                	je     1052be <check_boot_pgdir+0x2f7>
  10529a:	c7 44 24 0c c0 70 10 	movl   $0x1070c0,0xc(%esp)
  1052a1:	00 
  1052a2:	c7 44 24 08 99 6c 10 	movl   $0x106c99,0x8(%esp)
  1052a9:	00 
  1052aa:	c7 44 24 04 be 02 00 	movl   $0x2be,0x4(%esp)
  1052b1:	00 
  1052b2:	c7 04 24 74 6c 10 00 	movl   $0x106c74,(%esp)
  1052b9:	e8 75 b9 ff ff       	call   100c33 <__panic>
    // 在页面的 0x100 偏移处设置字符串结束符
    *(char *)(page2kva(p) + 0x100) = '\0';
  1052be:	8b 45 ec             	mov    -0x14(%ebp),%eax
  1052c1:	89 04 24             	mov    %eax,(%esp)
  1052c4:	e8 92 e9 ff ff       	call   103c5b <page2kva>
  1052c9:	05 00 01 00 00       	add    $0x100,%eax
  1052ce:	c6 00 00             	movb   $0x0,(%eax)
    assert(strlen((const char *)0x100) == 0);// 验证字符串长度为0
  1052d1:	c7 04 24 00 01 00 00 	movl   $0x100,(%esp)
  1052d8:	e8 47 09 00 00       	call   105c24 <strlen>
  1052dd:	85 c0                	test   %eax,%eax
  1052df:	74 24                	je     105305 <check_boot_pgdir+0x33e>
  1052e1:	c7 44 24 0c f8 70 10 	movl   $0x1070f8,0xc(%esp)
  1052e8:	00 
  1052e9:	c7 44 24 08 99 6c 10 	movl   $0x106c99,0x8(%esp)
  1052f0:	00 
  1052f1:	c7 44 24 04 c1 02 00 	movl   $0x2c1,0x4(%esp)
  1052f8:	00 
  1052f9:	c7 04 24 74 6c 10 00 	movl   $0x106c74,(%esp)
  105300:	e8 2e b9 ff ff       	call   100c33 <__panic>

    free_page(p);// 释放页面 p
  105305:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  10530c:	00 
  10530d:	8b 45 ec             	mov    -0x14(%ebp),%eax
  105310:	89 04 24             	mov    %eax,(%esp)
  105313:	e8 3d ec ff ff       	call   103f55 <free_pages>
    free_page(pde2page(boot_pgdir[0]));// 释放页目录项对应的页面
  105318:	a1 e0 99 11 00       	mov    0x1199e0,%eax
  10531d:	8b 00                	mov    (%eax),%eax
  10531f:	89 04 24             	mov    %eax,(%esp)
  105322:	e8 ca e9 ff ff       	call   103cf1 <pde2page>
  105327:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
  10532e:	00 
  10532f:	89 04 24             	mov    %eax,(%esp)
  105332:	e8 1e ec ff ff       	call   103f55 <free_pages>
    boot_pgdir[0] = 0;// 将页目录的第一个项设为0
  105337:	a1 e0 99 11 00       	mov    0x1199e0,%eax
  10533c:	c7 00 00 00 00 00    	movl   $0x0,(%eax)

    cprintf("check_boot_pgdir() succeeded!\n");// 输出成功信息
  105342:	c7 04 24 1c 71 10 00 	movl   $0x10711c,(%esp)
  105349:	e8 18 b0 ff ff       	call   100366 <cprintf>
}
  10534e:	90                   	nop
  10534f:	89 ec                	mov    %ebp,%esp
  105351:	5d                   	pop    %ebp
  105352:	c3                   	ret    

00105353 <perm2str>:

//perm2str - use string 'u,r,w,-' to present the permission
static const char *
perm2str(int perm) {
  105353:	55                   	push   %ebp
  105354:	89 e5                	mov    %esp,%ebp
    //定义一个静态字符数组 str，长度为4
    static char str[4];
    //如果 perm 与 PTE_U 按位与的结果不为0，则 str[0] 设置为 'u'，否则设置为 '-'
    str[0] = (perm & PTE_U) ? 'u' : '-';
  105356:	8b 45 08             	mov    0x8(%ebp),%eax
  105359:	83 e0 04             	and    $0x4,%eax
  10535c:	85 c0                	test   %eax,%eax
  10535e:	74 04                	je     105364 <perm2str+0x11>
  105360:	b0 75                	mov    $0x75,%al
  105362:	eb 02                	jmp    105366 <perm2str+0x13>
  105364:	b0 2d                	mov    $0x2d,%al
  105366:	a2 88 cf 11 00       	mov    %al,0x11cf88
    //str[1] 始终设置为 'r'
    str[1] = 'r';
  10536b:	c6 05 89 cf 11 00 72 	movb   $0x72,0x11cf89
    //如果 perm 与 PTE_W 按位与的结果不为0，则 str[2] 设置为 'w'，否则设置为 '-'
    str[2] = (perm & PTE_W) ? 'w' : '-';
  105372:	8b 45 08             	mov    0x8(%ebp),%eax
  105375:	83 e0 02             	and    $0x2,%eax
  105378:	85 c0                	test   %eax,%eax
  10537a:	74 04                	je     105380 <perm2str+0x2d>
  10537c:	b0 77                	mov    $0x77,%al
  10537e:	eb 02                	jmp    105382 <perm2str+0x2f>
  105380:	b0 2d                	mov    $0x2d,%al
  105382:	a2 8a cf 11 00       	mov    %al,0x11cf8a
    //str[3] 设置为字符串结束符 \0
    str[3] = '\0';
  105387:	c6 05 8b cf 11 00 00 	movb   $0x0,0x11cf8b
    return str;
  10538e:	b8 88 cf 11 00       	mov    $0x11cf88,%eax
}
  105393:	5d                   	pop    %ebp
  105394:	c3                   	ret    

00105395 <get_pgtable_items>:
//  left_store:  the pointer of the high side of table's next range
//  right_store: the pointer of the low side of table's next range
// return value: 0 - not a invalid item range, perm - a valid item range with perm permission 
//从页表中获取指定范围内的有效项，并根据权限进行处理。
static int
get_pgtable_items(size_t left, size_t right, size_t start, uintptr_t *table, size_t *left_store, size_t *right_store) {
  105395:	55                   	push   %ebp
  105396:	89 e5                	mov    %esp,%ebp
  105398:	83 ec 10             	sub    $0x10,%esp
    if (start >= right) {// 检查起始索引是否超出右边界
  10539b:	8b 45 10             	mov    0x10(%ebp),%eax
  10539e:	3b 45 0c             	cmp    0xc(%ebp),%eax
  1053a1:	72 0d                	jb     1053b0 <get_pgtable_items+0x1b>
        return 0;// 如果超出右边界，返回0
  1053a3:	b8 00 00 00 00       	mov    $0x0,%eax
  1053a8:	e9 98 00 00 00       	jmp    105445 <get_pgtable_items+0xb0>
    }
    while (start < right && !(table[start] & PTE_P)) {// 查找第一个有效项（PTE_P位为1的项）
        start ++;// 索引递增
  1053ad:	ff 45 10             	incl   0x10(%ebp)
    while (start < right && !(table[start] & PTE_P)) {// 查找第一个有效项（PTE_P位为1的项）
  1053b0:	8b 45 10             	mov    0x10(%ebp),%eax
  1053b3:	3b 45 0c             	cmp    0xc(%ebp),%eax
  1053b6:	73 18                	jae    1053d0 <get_pgtable_items+0x3b>
  1053b8:	8b 45 10             	mov    0x10(%ebp),%eax
  1053bb:	8d 14 85 00 00 00 00 	lea    0x0(,%eax,4),%edx
  1053c2:	8b 45 14             	mov    0x14(%ebp),%eax
  1053c5:	01 d0                	add    %edx,%eax
  1053c7:	8b 00                	mov    (%eax),%eax
  1053c9:	83 e0 01             	and    $0x1,%eax
  1053cc:	85 c0                	test   %eax,%eax
  1053ce:	74 dd                	je     1053ad <get_pgtable_items+0x18>
    }
    if (start < right) {// 检查是否找到有效项
  1053d0:	8b 45 10             	mov    0x10(%ebp),%eax
  1053d3:	3b 45 0c             	cmp    0xc(%ebp),%eax
  1053d6:	73 68                	jae    105440 <get_pgtable_items+0xab>
        if (left_store != NULL) {// 如果left_store不为NULL
  1053d8:	83 7d 18 00          	cmpl   $0x0,0x18(%ebp)
  1053dc:	74 08                	je     1053e6 <get_pgtable_items+0x51>
            *left_store = start;// 记录左边界索引
  1053de:	8b 45 18             	mov    0x18(%ebp),%eax
  1053e1:	8b 55 10             	mov    0x10(%ebp),%edx
  1053e4:	89 10                	mov    %edx,(%eax)
        }
        int perm = (table[start ++] & PTE_USER);// 获取当前项的用户权限位并递增索引
  1053e6:	8b 45 10             	mov    0x10(%ebp),%eax
  1053e9:	8d 50 01             	lea    0x1(%eax),%edx
  1053ec:	89 55 10             	mov    %edx,0x10(%ebp)
  1053ef:	8d 14 85 00 00 00 00 	lea    0x0(,%eax,4),%edx
  1053f6:	8b 45 14             	mov    0x14(%ebp),%eax
  1053f9:	01 d0                	add    %edx,%eax
  1053fb:	8b 00                	mov    (%eax),%eax
  1053fd:	83 e0 07             	and    $0x7,%eax
  105400:	89 45 fc             	mov    %eax,-0x4(%ebp)
        while (start < right && (table[start] & PTE_USER) == perm) {// 查找具有相同用户权限的连续项
  105403:	eb 03                	jmp    105408 <get_pgtable_items+0x73>
            start ++;// 索引递增
  105405:	ff 45 10             	incl   0x10(%ebp)
        while (start < right && (table[start] & PTE_USER) == perm) {// 查找具有相同用户权限的连续项
  105408:	8b 45 10             	mov    0x10(%ebp),%eax
  10540b:	3b 45 0c             	cmp    0xc(%ebp),%eax
  10540e:	73 1d                	jae    10542d <get_pgtable_items+0x98>
  105410:	8b 45 10             	mov    0x10(%ebp),%eax
  105413:	8d 14 85 00 00 00 00 	lea    0x0(,%eax,4),%edx
  10541a:	8b 45 14             	mov    0x14(%ebp),%eax
  10541d:	01 d0                	add    %edx,%eax
  10541f:	8b 00                	mov    (%eax),%eax
  105421:	83 e0 07             	and    $0x7,%eax
  105424:	89 c2                	mov    %eax,%edx
  105426:	8b 45 fc             	mov    -0x4(%ebp),%eax
  105429:	39 c2                	cmp    %eax,%edx
  10542b:	74 d8                	je     105405 <get_pgtable_items+0x70>
        }
        if (right_store != NULL) {// 如果right_store不为NULL
  10542d:	83 7d 1c 00          	cmpl   $0x0,0x1c(%ebp)
  105431:	74 08                	je     10543b <get_pgtable_items+0xa6>
            *right_store = start;// 记录右边界索引
  105433:	8b 45 1c             	mov    0x1c(%ebp),%eax
  105436:	8b 55 10             	mov    0x10(%ebp),%edx
  105439:	89 10                	mov    %edx,(%eax)
        }
        return perm;// 返回用户权限位
  10543b:	8b 45 fc             	mov    -0x4(%ebp),%eax
  10543e:	eb 05                	jmp    105445 <get_pgtable_items+0xb0>
    }
    return 0;// 如果未找到有效项，返回0
  105440:	b8 00 00 00 00       	mov    $0x0,%eax
}
  105445:	89 ec                	mov    %ebp,%esp
  105447:	5d                   	pop    %ebp
  105448:	c3                   	ret    

00105449 <print_pgdir>:

//print_pgdir - print the PDT&PT
void
print_pgdir(void) {
  105449:	55                   	push   %ebp
  10544a:	89 e5                	mov    %esp,%ebp
  10544c:	57                   	push   %edi
  10544d:	56                   	push   %esi
  10544e:	53                   	push   %ebx
  10544f:	83 ec 4c             	sub    $0x4c,%esp
    cprintf("-------------------- BEGIN --------------------\n");
  105452:	c7 04 24 3c 71 10 00 	movl   $0x10713c,(%esp)
  105459:	e8 08 af ff ff       	call   100366 <cprintf>
    // 定义变量 left, right 和 perm
    size_t left, right = 0, perm;
  10545e:	c7 45 dc 00 00 00 00 	movl   $0x0,-0x24(%ebp)
    // 遍历页目录项
    while ((perm = get_pgtable_items(0, NPDEENTRY, right, vpd, &left, &right)) != 0) {
  105465:	e9 f2 00 00 00       	jmp    10555c <print_pgdir+0x113>
        // 打印页目录项的信息
        cprintf("PDE(%03x) %08x-%08x %08x %s\n", right - left,
  10546a:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  10546d:	89 04 24             	mov    %eax,(%esp)
  105470:	e8 de fe ff ff       	call   105353 <perm2str>
                left * PTSIZE, right * PTSIZE, (right - left) * PTSIZE, perm2str(perm));
  105475:	8b 55 dc             	mov    -0x24(%ebp),%edx
  105478:	8b 4d e0             	mov    -0x20(%ebp),%ecx
  10547b:	29 ca                	sub    %ecx,%edx
        cprintf("PDE(%03x) %08x-%08x %08x %s\n", right - left,
  10547d:	89 d6                	mov    %edx,%esi
  10547f:	c1 e6 16             	shl    $0x16,%esi
  105482:	8b 55 dc             	mov    -0x24(%ebp),%edx
  105485:	89 d3                	mov    %edx,%ebx
  105487:	c1 e3 16             	shl    $0x16,%ebx
  10548a:	8b 55 e0             	mov    -0x20(%ebp),%edx
  10548d:	89 d1                	mov    %edx,%ecx
  10548f:	c1 e1 16             	shl    $0x16,%ecx
  105492:	8b 55 dc             	mov    -0x24(%ebp),%edx
  105495:	8b 7d e0             	mov    -0x20(%ebp),%edi
  105498:	29 fa                	sub    %edi,%edx
  10549a:	89 44 24 14          	mov    %eax,0x14(%esp)
  10549e:	89 74 24 10          	mov    %esi,0x10(%esp)
  1054a2:	89 5c 24 0c          	mov    %ebx,0xc(%esp)
  1054a6:	89 4c 24 08          	mov    %ecx,0x8(%esp)
  1054aa:	89 54 24 04          	mov    %edx,0x4(%esp)
  1054ae:	c7 04 24 6d 71 10 00 	movl   $0x10716d,(%esp)
  1054b5:	e8 ac ae ff ff       	call   100366 <cprintf>
        // 计算页表项的起始和结束索引
        size_t l, r = left * NPTEENTRY;
  1054ba:	8b 45 e0             	mov    -0x20(%ebp),%eax
  1054bd:	c1 e0 0a             	shl    $0xa,%eax
  1054c0:	89 45 d4             	mov    %eax,-0x2c(%ebp)
        // 遍历页表项
        while ((perm = get_pgtable_items(left * NPTEENTRY, right * NPTEENTRY, r, vpt, &l, &r)) != 0) {
  1054c3:	eb 50                	jmp    105515 <print_pgdir+0xcc>
            // 打印页表项的信息
            cprintf("  |-- PTE(%05x) %08x-%08x %08x %s\n", r - l,
  1054c5:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  1054c8:	89 04 24             	mov    %eax,(%esp)
  1054cb:	e8 83 fe ff ff       	call   105353 <perm2str>
                    l * PGSIZE, r * PGSIZE, (r - l) * PGSIZE, perm2str(perm));
  1054d0:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  1054d3:	8b 4d d8             	mov    -0x28(%ebp),%ecx
  1054d6:	29 ca                	sub    %ecx,%edx
            cprintf("  |-- PTE(%05x) %08x-%08x %08x %s\n", r - l,
  1054d8:	89 d6                	mov    %edx,%esi
  1054da:	c1 e6 0c             	shl    $0xc,%esi
  1054dd:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  1054e0:	89 d3                	mov    %edx,%ebx
  1054e2:	c1 e3 0c             	shl    $0xc,%ebx
  1054e5:	8b 55 d8             	mov    -0x28(%ebp),%edx
  1054e8:	89 d1                	mov    %edx,%ecx
  1054ea:	c1 e1 0c             	shl    $0xc,%ecx
  1054ed:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  1054f0:	8b 7d d8             	mov    -0x28(%ebp),%edi
  1054f3:	29 fa                	sub    %edi,%edx
  1054f5:	89 44 24 14          	mov    %eax,0x14(%esp)
  1054f9:	89 74 24 10          	mov    %esi,0x10(%esp)
  1054fd:	89 5c 24 0c          	mov    %ebx,0xc(%esp)
  105501:	89 4c 24 08          	mov    %ecx,0x8(%esp)
  105505:	89 54 24 04          	mov    %edx,0x4(%esp)
  105509:	c7 04 24 8c 71 10 00 	movl   $0x10718c,(%esp)
  105510:	e8 51 ae ff ff       	call   100366 <cprintf>
        while ((perm = get_pgtable_items(left * NPTEENTRY, right * NPTEENTRY, r, vpt, &l, &r)) != 0) {
  105515:	be 00 00 c0 fa       	mov    $0xfac00000,%esi
  10551a:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  10551d:	8b 55 dc             	mov    -0x24(%ebp),%edx
  105520:	89 d3                	mov    %edx,%ebx
  105522:	c1 e3 0a             	shl    $0xa,%ebx
  105525:	8b 55 e0             	mov    -0x20(%ebp),%edx
  105528:	89 d1                	mov    %edx,%ecx
  10552a:	c1 e1 0a             	shl    $0xa,%ecx
  10552d:	8d 55 d4             	lea    -0x2c(%ebp),%edx
  105530:	89 54 24 14          	mov    %edx,0x14(%esp)
  105534:	8d 55 d8             	lea    -0x28(%ebp),%edx
  105537:	89 54 24 10          	mov    %edx,0x10(%esp)
  10553b:	89 74 24 0c          	mov    %esi,0xc(%esp)
  10553f:	89 44 24 08          	mov    %eax,0x8(%esp)
  105543:	89 5c 24 04          	mov    %ebx,0x4(%esp)
  105547:	89 0c 24             	mov    %ecx,(%esp)
  10554a:	e8 46 fe ff ff       	call   105395 <get_pgtable_items>
  10554f:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  105552:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
  105556:	0f 85 69 ff ff ff    	jne    1054c5 <print_pgdir+0x7c>
    while ((perm = get_pgtable_items(0, NPDEENTRY, right, vpd, &left, &right)) != 0) {
  10555c:	b9 00 b0 fe fa       	mov    $0xfafeb000,%ecx
  105561:	8b 45 dc             	mov    -0x24(%ebp),%eax
  105564:	8d 55 dc             	lea    -0x24(%ebp),%edx
  105567:	89 54 24 14          	mov    %edx,0x14(%esp)
  10556b:	8d 55 e0             	lea    -0x20(%ebp),%edx
  10556e:	89 54 24 10          	mov    %edx,0x10(%esp)
  105572:	89 4c 24 0c          	mov    %ecx,0xc(%esp)
  105576:	89 44 24 08          	mov    %eax,0x8(%esp)
  10557a:	c7 44 24 04 00 04 00 	movl   $0x400,0x4(%esp)
  105581:	00 
  105582:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  105589:	e8 07 fe ff ff       	call   105395 <get_pgtable_items>
  10558e:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  105591:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
  105595:	0f 85 cf fe ff ff    	jne    10546a <print_pgdir+0x21>
        }
    }
    cprintf("--------------------- END ---------------------\n");
  10559b:	c7 04 24 b0 71 10 00 	movl   $0x1071b0,(%esp)
  1055a2:	e8 bf ad ff ff       	call   100366 <cprintf>
}
  1055a7:	90                   	nop
  1055a8:	83 c4 4c             	add    $0x4c,%esp
  1055ab:	5b                   	pop    %ebx
  1055ac:	5e                   	pop    %esi
  1055ad:	5f                   	pop    %edi
  1055ae:	5d                   	pop    %ebp
  1055af:	c3                   	ret    

001055b0 <printnum>:
 * @width:      maximum number of digits, if the actual width is less than @width, use @padc instead
 * @padc:       character that padded on the left if the actual width is less than @width
 * */
static void
printnum(void (*putch)(int, void*), void *putdat,
        unsigned long long num, unsigned base, int width, int padc) {
  1055b0:	55                   	push   %ebp
  1055b1:	89 e5                	mov    %esp,%ebp
  1055b3:	83 ec 58             	sub    $0x58,%esp
  1055b6:	8b 45 10             	mov    0x10(%ebp),%eax
  1055b9:	89 45 d0             	mov    %eax,-0x30(%ebp)
  1055bc:	8b 45 14             	mov    0x14(%ebp),%eax
  1055bf:	89 45 d4             	mov    %eax,-0x2c(%ebp)
    unsigned long long result = num;
  1055c2:	8b 45 d0             	mov    -0x30(%ebp),%eax
  1055c5:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  1055c8:	89 45 e8             	mov    %eax,-0x18(%ebp)
  1055cb:	89 55 ec             	mov    %edx,-0x14(%ebp)
    unsigned mod = do_div(result, base);
  1055ce:	8b 45 18             	mov    0x18(%ebp),%eax
  1055d1:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  1055d4:	8b 45 e8             	mov    -0x18(%ebp),%eax
  1055d7:	8b 55 ec             	mov    -0x14(%ebp),%edx
  1055da:	89 45 e0             	mov    %eax,-0x20(%ebp)
  1055dd:	89 55 f0             	mov    %edx,-0x10(%ebp)
  1055e0:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1055e3:	89 45 f4             	mov    %eax,-0xc(%ebp)
  1055e6:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
  1055ea:	74 1c                	je     105608 <printnum+0x58>
  1055ec:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1055ef:	ba 00 00 00 00       	mov    $0x0,%edx
  1055f4:	f7 75 e4             	divl   -0x1c(%ebp)
  1055f7:	89 55 f4             	mov    %edx,-0xc(%ebp)
  1055fa:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1055fd:	ba 00 00 00 00       	mov    $0x0,%edx
  105602:	f7 75 e4             	divl   -0x1c(%ebp)
  105605:	89 45 f0             	mov    %eax,-0x10(%ebp)
  105608:	8b 45 e0             	mov    -0x20(%ebp),%eax
  10560b:	8b 55 f4             	mov    -0xc(%ebp),%edx
  10560e:	f7 75 e4             	divl   -0x1c(%ebp)
  105611:	89 45 e0             	mov    %eax,-0x20(%ebp)
  105614:	89 55 dc             	mov    %edx,-0x24(%ebp)
  105617:	8b 45 e0             	mov    -0x20(%ebp),%eax
  10561a:	8b 55 f0             	mov    -0x10(%ebp),%edx
  10561d:	89 45 e8             	mov    %eax,-0x18(%ebp)
  105620:	89 55 ec             	mov    %edx,-0x14(%ebp)
  105623:	8b 45 dc             	mov    -0x24(%ebp),%eax
  105626:	89 45 d8             	mov    %eax,-0x28(%ebp)

    // first recursively print all preceding (more significant) digits
    if (num >= base) {
  105629:	8b 45 18             	mov    0x18(%ebp),%eax
  10562c:	ba 00 00 00 00       	mov    $0x0,%edx
  105631:	8b 4d d4             	mov    -0x2c(%ebp),%ecx
  105634:	39 45 d0             	cmp    %eax,-0x30(%ebp)
  105637:	19 d1                	sbb    %edx,%ecx
  105639:	72 4c                	jb     105687 <printnum+0xd7>
        printnum(putch, putdat, result, base, width - 1, padc);
  10563b:	8b 45 1c             	mov    0x1c(%ebp),%eax
  10563e:	8d 50 ff             	lea    -0x1(%eax),%edx
  105641:	8b 45 20             	mov    0x20(%ebp),%eax
  105644:	89 44 24 18          	mov    %eax,0x18(%esp)
  105648:	89 54 24 14          	mov    %edx,0x14(%esp)
  10564c:	8b 45 18             	mov    0x18(%ebp),%eax
  10564f:	89 44 24 10          	mov    %eax,0x10(%esp)
  105653:	8b 45 e8             	mov    -0x18(%ebp),%eax
  105656:	8b 55 ec             	mov    -0x14(%ebp),%edx
  105659:	89 44 24 08          	mov    %eax,0x8(%esp)
  10565d:	89 54 24 0c          	mov    %edx,0xc(%esp)
  105661:	8b 45 0c             	mov    0xc(%ebp),%eax
  105664:	89 44 24 04          	mov    %eax,0x4(%esp)
  105668:	8b 45 08             	mov    0x8(%ebp),%eax
  10566b:	89 04 24             	mov    %eax,(%esp)
  10566e:	e8 3d ff ff ff       	call   1055b0 <printnum>
  105673:	eb 1b                	jmp    105690 <printnum+0xe0>
    } else {
        // print any needed pad characters before first digit
        while (-- width > 0)
            putch(padc, putdat);
  105675:	8b 45 0c             	mov    0xc(%ebp),%eax
  105678:	89 44 24 04          	mov    %eax,0x4(%esp)
  10567c:	8b 45 20             	mov    0x20(%ebp),%eax
  10567f:	89 04 24             	mov    %eax,(%esp)
  105682:	8b 45 08             	mov    0x8(%ebp),%eax
  105685:	ff d0                	call   *%eax
        while (-- width > 0)
  105687:	ff 4d 1c             	decl   0x1c(%ebp)
  10568a:	83 7d 1c 00          	cmpl   $0x0,0x1c(%ebp)
  10568e:	7f e5                	jg     105675 <printnum+0xc5>
    }
    // then print this (the least significant) digit
    putch("0123456789abcdef"[mod], putdat);
  105690:	8b 45 d8             	mov    -0x28(%ebp),%eax
  105693:	05 64 72 10 00       	add    $0x107264,%eax
  105698:	0f b6 00             	movzbl (%eax),%eax
  10569b:	0f be c0             	movsbl %al,%eax
  10569e:	8b 55 0c             	mov    0xc(%ebp),%edx
  1056a1:	89 54 24 04          	mov    %edx,0x4(%esp)
  1056a5:	89 04 24             	mov    %eax,(%esp)
  1056a8:	8b 45 08             	mov    0x8(%ebp),%eax
  1056ab:	ff d0                	call   *%eax
}
  1056ad:	90                   	nop
  1056ae:	89 ec                	mov    %ebp,%esp
  1056b0:	5d                   	pop    %ebp
  1056b1:	c3                   	ret    

001056b2 <getuint>:
 * getuint - get an unsigned int of various possible sizes from a varargs list
 * @ap:         a varargs list pointer
 * @lflag:      determines the size of the vararg that @ap points to
 * */
static unsigned long long
getuint(va_list *ap, int lflag) {
  1056b2:	55                   	push   %ebp
  1056b3:	89 e5                	mov    %esp,%ebp
    if (lflag >= 2) {
  1056b5:	83 7d 0c 01          	cmpl   $0x1,0xc(%ebp)
  1056b9:	7e 14                	jle    1056cf <getuint+0x1d>
        return va_arg(*ap, unsigned long long);
  1056bb:	8b 45 08             	mov    0x8(%ebp),%eax
  1056be:	8b 00                	mov    (%eax),%eax
  1056c0:	8d 48 08             	lea    0x8(%eax),%ecx
  1056c3:	8b 55 08             	mov    0x8(%ebp),%edx
  1056c6:	89 0a                	mov    %ecx,(%edx)
  1056c8:	8b 50 04             	mov    0x4(%eax),%edx
  1056cb:	8b 00                	mov    (%eax),%eax
  1056cd:	eb 30                	jmp    1056ff <getuint+0x4d>
    }
    else if (lflag) {
  1056cf:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
  1056d3:	74 16                	je     1056eb <getuint+0x39>
        return va_arg(*ap, unsigned long);
  1056d5:	8b 45 08             	mov    0x8(%ebp),%eax
  1056d8:	8b 00                	mov    (%eax),%eax
  1056da:	8d 48 04             	lea    0x4(%eax),%ecx
  1056dd:	8b 55 08             	mov    0x8(%ebp),%edx
  1056e0:	89 0a                	mov    %ecx,(%edx)
  1056e2:	8b 00                	mov    (%eax),%eax
  1056e4:	ba 00 00 00 00       	mov    $0x0,%edx
  1056e9:	eb 14                	jmp    1056ff <getuint+0x4d>
    }
    else {
        return va_arg(*ap, unsigned int);
  1056eb:	8b 45 08             	mov    0x8(%ebp),%eax
  1056ee:	8b 00                	mov    (%eax),%eax
  1056f0:	8d 48 04             	lea    0x4(%eax),%ecx
  1056f3:	8b 55 08             	mov    0x8(%ebp),%edx
  1056f6:	89 0a                	mov    %ecx,(%edx)
  1056f8:	8b 00                	mov    (%eax),%eax
  1056fa:	ba 00 00 00 00       	mov    $0x0,%edx
    }
}
  1056ff:	5d                   	pop    %ebp
  105700:	c3                   	ret    

00105701 <getint>:
 * getint - same as getuint but signed, we can't use getuint because of sign extension
 * @ap:         a varargs list pointer
 * @lflag:      determines the size of the vararg that @ap points to
 * */
static long long
getint(va_list *ap, int lflag) {
  105701:	55                   	push   %ebp
  105702:	89 e5                	mov    %esp,%ebp
    if (lflag >= 2) {
  105704:	83 7d 0c 01          	cmpl   $0x1,0xc(%ebp)
  105708:	7e 14                	jle    10571e <getint+0x1d>
        return va_arg(*ap, long long);
  10570a:	8b 45 08             	mov    0x8(%ebp),%eax
  10570d:	8b 00                	mov    (%eax),%eax
  10570f:	8d 48 08             	lea    0x8(%eax),%ecx
  105712:	8b 55 08             	mov    0x8(%ebp),%edx
  105715:	89 0a                	mov    %ecx,(%edx)
  105717:	8b 50 04             	mov    0x4(%eax),%edx
  10571a:	8b 00                	mov    (%eax),%eax
  10571c:	eb 28                	jmp    105746 <getint+0x45>
    }
    else if (lflag) {
  10571e:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
  105722:	74 12                	je     105736 <getint+0x35>
        return va_arg(*ap, long);
  105724:	8b 45 08             	mov    0x8(%ebp),%eax
  105727:	8b 00                	mov    (%eax),%eax
  105729:	8d 48 04             	lea    0x4(%eax),%ecx
  10572c:	8b 55 08             	mov    0x8(%ebp),%edx
  10572f:	89 0a                	mov    %ecx,(%edx)
  105731:	8b 00                	mov    (%eax),%eax
  105733:	99                   	cltd   
  105734:	eb 10                	jmp    105746 <getint+0x45>
    }
    else {
        return va_arg(*ap, int);
  105736:	8b 45 08             	mov    0x8(%ebp),%eax
  105739:	8b 00                	mov    (%eax),%eax
  10573b:	8d 48 04             	lea    0x4(%eax),%ecx
  10573e:	8b 55 08             	mov    0x8(%ebp),%edx
  105741:	89 0a                	mov    %ecx,(%edx)
  105743:	8b 00                	mov    (%eax),%eax
  105745:	99                   	cltd   
    }
}
  105746:	5d                   	pop    %ebp
  105747:	c3                   	ret    

00105748 <printfmt>:
 * @putch:      specified putch function, print a single character
 * @putdat:     used by @putch function
 * @fmt:        the format string to use
 * */
void
printfmt(void (*putch)(int, void*), void *putdat, const char *fmt, ...) {
  105748:	55                   	push   %ebp
  105749:	89 e5                	mov    %esp,%ebp
  10574b:	83 ec 28             	sub    $0x28,%esp
    va_list ap;

    va_start(ap, fmt);
  10574e:	8d 45 14             	lea    0x14(%ebp),%eax
  105751:	89 45 f4             	mov    %eax,-0xc(%ebp)
    vprintfmt(putch, putdat, fmt, ap);
  105754:	8b 45 f4             	mov    -0xc(%ebp),%eax
  105757:	89 44 24 0c          	mov    %eax,0xc(%esp)
  10575b:	8b 45 10             	mov    0x10(%ebp),%eax
  10575e:	89 44 24 08          	mov    %eax,0x8(%esp)
  105762:	8b 45 0c             	mov    0xc(%ebp),%eax
  105765:	89 44 24 04          	mov    %eax,0x4(%esp)
  105769:	8b 45 08             	mov    0x8(%ebp),%eax
  10576c:	89 04 24             	mov    %eax,(%esp)
  10576f:	e8 05 00 00 00       	call   105779 <vprintfmt>
    va_end(ap);
}
  105774:	90                   	nop
  105775:	89 ec                	mov    %ebp,%esp
  105777:	5d                   	pop    %ebp
  105778:	c3                   	ret    

00105779 <vprintfmt>:
 *
 * Call this function if you are already dealing with a va_list.
 * Or you probably want printfmt() instead.
 * */
void
vprintfmt(void (*putch)(int, void*), void *putdat, const char *fmt, va_list ap) {
  105779:	55                   	push   %ebp
  10577a:	89 e5                	mov    %esp,%ebp
  10577c:	56                   	push   %esi
  10577d:	53                   	push   %ebx
  10577e:	83 ec 40             	sub    $0x40,%esp
    register int ch, err;
    unsigned long long num;
    int base, width, precision, lflag, altflag;

    while (1) {
        while ((ch = *(unsigned char *)fmt ++) != '%') {
  105781:	eb 17                	jmp    10579a <vprintfmt+0x21>
            if (ch == '\0') {
  105783:	85 db                	test   %ebx,%ebx
  105785:	0f 84 bf 03 00 00    	je     105b4a <vprintfmt+0x3d1>
                return;
            }
            putch(ch, putdat);
  10578b:	8b 45 0c             	mov    0xc(%ebp),%eax
  10578e:	89 44 24 04          	mov    %eax,0x4(%esp)
  105792:	89 1c 24             	mov    %ebx,(%esp)
  105795:	8b 45 08             	mov    0x8(%ebp),%eax
  105798:	ff d0                	call   *%eax
        while ((ch = *(unsigned char *)fmt ++) != '%') {
  10579a:	8b 45 10             	mov    0x10(%ebp),%eax
  10579d:	8d 50 01             	lea    0x1(%eax),%edx
  1057a0:	89 55 10             	mov    %edx,0x10(%ebp)
  1057a3:	0f b6 00             	movzbl (%eax),%eax
  1057a6:	0f b6 d8             	movzbl %al,%ebx
  1057a9:	83 fb 25             	cmp    $0x25,%ebx
  1057ac:	75 d5                	jne    105783 <vprintfmt+0xa>
        }

        // Process a %-escape sequence
        char padc = ' ';
  1057ae:	c6 45 db 20          	movb   $0x20,-0x25(%ebp)
        width = precision = -1;
  1057b2:	c7 45 e4 ff ff ff ff 	movl   $0xffffffff,-0x1c(%ebp)
  1057b9:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  1057bc:	89 45 e8             	mov    %eax,-0x18(%ebp)
        lflag = altflag = 0;
  1057bf:	c7 45 dc 00 00 00 00 	movl   $0x0,-0x24(%ebp)
  1057c6:	8b 45 dc             	mov    -0x24(%ebp),%eax
  1057c9:	89 45 e0             	mov    %eax,-0x20(%ebp)

    reswitch:
        switch (ch = *(unsigned char *)fmt ++) {
  1057cc:	8b 45 10             	mov    0x10(%ebp),%eax
  1057cf:	8d 50 01             	lea    0x1(%eax),%edx
  1057d2:	89 55 10             	mov    %edx,0x10(%ebp)
  1057d5:	0f b6 00             	movzbl (%eax),%eax
  1057d8:	0f b6 d8             	movzbl %al,%ebx
  1057db:	8d 43 dd             	lea    -0x23(%ebx),%eax
  1057de:	83 f8 55             	cmp    $0x55,%eax
  1057e1:	0f 87 37 03 00 00    	ja     105b1e <vprintfmt+0x3a5>
  1057e7:	8b 04 85 88 72 10 00 	mov    0x107288(,%eax,4),%eax
  1057ee:	ff e0                	jmp    *%eax

        // flag to pad on the right
        case '-':
            padc = '-';
  1057f0:	c6 45 db 2d          	movb   $0x2d,-0x25(%ebp)
            goto reswitch;
  1057f4:	eb d6                	jmp    1057cc <vprintfmt+0x53>

        // flag to pad with 0's instead of spaces
        case '0':
            padc = '0';
  1057f6:	c6 45 db 30          	movb   $0x30,-0x25(%ebp)
            goto reswitch;
  1057fa:	eb d0                	jmp    1057cc <vprintfmt+0x53>

        // width field
        case '1' ... '9':
            for (precision = 0; ; ++ fmt) {
  1057fc:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
                precision = precision * 10 + ch - '0';
  105803:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  105806:	89 d0                	mov    %edx,%eax
  105808:	c1 e0 02             	shl    $0x2,%eax
  10580b:	01 d0                	add    %edx,%eax
  10580d:	01 c0                	add    %eax,%eax
  10580f:	01 d8                	add    %ebx,%eax
  105811:	83 e8 30             	sub    $0x30,%eax
  105814:	89 45 e4             	mov    %eax,-0x1c(%ebp)
                ch = *fmt;
  105817:	8b 45 10             	mov    0x10(%ebp),%eax
  10581a:	0f b6 00             	movzbl (%eax),%eax
  10581d:	0f be d8             	movsbl %al,%ebx
                if (ch < '0' || ch > '9') {
  105820:	83 fb 2f             	cmp    $0x2f,%ebx
  105823:	7e 38                	jle    10585d <vprintfmt+0xe4>
  105825:	83 fb 39             	cmp    $0x39,%ebx
  105828:	7f 33                	jg     10585d <vprintfmt+0xe4>
            for (precision = 0; ; ++ fmt) {
  10582a:	ff 45 10             	incl   0x10(%ebp)
                precision = precision * 10 + ch - '0';
  10582d:	eb d4                	jmp    105803 <vprintfmt+0x8a>
                }
            }
            goto process_precision;

        case '*':
            precision = va_arg(ap, int);
  10582f:	8b 45 14             	mov    0x14(%ebp),%eax
  105832:	8d 50 04             	lea    0x4(%eax),%edx
  105835:	89 55 14             	mov    %edx,0x14(%ebp)
  105838:	8b 00                	mov    (%eax),%eax
  10583a:	89 45 e4             	mov    %eax,-0x1c(%ebp)
            goto process_precision;
  10583d:	eb 1f                	jmp    10585e <vprintfmt+0xe5>

        case '.':
            if (width < 0)
  10583f:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
  105843:	79 87                	jns    1057cc <vprintfmt+0x53>
                width = 0;
  105845:	c7 45 e8 00 00 00 00 	movl   $0x0,-0x18(%ebp)
            goto reswitch;
  10584c:	e9 7b ff ff ff       	jmp    1057cc <vprintfmt+0x53>

        case '#':
            altflag = 1;
  105851:	c7 45 dc 01 00 00 00 	movl   $0x1,-0x24(%ebp)
            goto reswitch;
  105858:	e9 6f ff ff ff       	jmp    1057cc <vprintfmt+0x53>
            goto process_precision;
  10585d:	90                   	nop

        process_precision:
            if (width < 0)
  10585e:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
  105862:	0f 89 64 ff ff ff    	jns    1057cc <vprintfmt+0x53>
                width = precision, precision = -1;
  105868:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  10586b:	89 45 e8             	mov    %eax,-0x18(%ebp)
  10586e:	c7 45 e4 ff ff ff ff 	movl   $0xffffffff,-0x1c(%ebp)
            goto reswitch;
  105875:	e9 52 ff ff ff       	jmp    1057cc <vprintfmt+0x53>

        // long flag (doubled for long long)
        case 'l':
            lflag ++;
  10587a:	ff 45 e0             	incl   -0x20(%ebp)
            goto reswitch;
  10587d:	e9 4a ff ff ff       	jmp    1057cc <vprintfmt+0x53>

        // character
        case 'c':
            putch(va_arg(ap, int), putdat);
  105882:	8b 45 14             	mov    0x14(%ebp),%eax
  105885:	8d 50 04             	lea    0x4(%eax),%edx
  105888:	89 55 14             	mov    %edx,0x14(%ebp)
  10588b:	8b 00                	mov    (%eax),%eax
  10588d:	8b 55 0c             	mov    0xc(%ebp),%edx
  105890:	89 54 24 04          	mov    %edx,0x4(%esp)
  105894:	89 04 24             	mov    %eax,(%esp)
  105897:	8b 45 08             	mov    0x8(%ebp),%eax
  10589a:	ff d0                	call   *%eax
            break;
  10589c:	e9 a4 02 00 00       	jmp    105b45 <vprintfmt+0x3cc>

        // error message
        case 'e':
            err = va_arg(ap, int);
  1058a1:	8b 45 14             	mov    0x14(%ebp),%eax
  1058a4:	8d 50 04             	lea    0x4(%eax),%edx
  1058a7:	89 55 14             	mov    %edx,0x14(%ebp)
  1058aa:	8b 18                	mov    (%eax),%ebx
            if (err < 0) {
  1058ac:	85 db                	test   %ebx,%ebx
  1058ae:	79 02                	jns    1058b2 <vprintfmt+0x139>
                err = -err;
  1058b0:	f7 db                	neg    %ebx
            }
            if (err > MAXERROR || (p = error_string[err]) == NULL) {
  1058b2:	83 fb 06             	cmp    $0x6,%ebx
  1058b5:	7f 0b                	jg     1058c2 <vprintfmt+0x149>
  1058b7:	8b 34 9d 48 72 10 00 	mov    0x107248(,%ebx,4),%esi
  1058be:	85 f6                	test   %esi,%esi
  1058c0:	75 23                	jne    1058e5 <vprintfmt+0x16c>
                printfmt(putch, putdat, "error %d", err);
  1058c2:	89 5c 24 0c          	mov    %ebx,0xc(%esp)
  1058c6:	c7 44 24 08 75 72 10 	movl   $0x107275,0x8(%esp)
  1058cd:	00 
  1058ce:	8b 45 0c             	mov    0xc(%ebp),%eax
  1058d1:	89 44 24 04          	mov    %eax,0x4(%esp)
  1058d5:	8b 45 08             	mov    0x8(%ebp),%eax
  1058d8:	89 04 24             	mov    %eax,(%esp)
  1058db:	e8 68 fe ff ff       	call   105748 <printfmt>
            }
            else {
                printfmt(putch, putdat, "%s", p);
            }
            break;
  1058e0:	e9 60 02 00 00       	jmp    105b45 <vprintfmt+0x3cc>
                printfmt(putch, putdat, "%s", p);
  1058e5:	89 74 24 0c          	mov    %esi,0xc(%esp)
  1058e9:	c7 44 24 08 7e 72 10 	movl   $0x10727e,0x8(%esp)
  1058f0:	00 
  1058f1:	8b 45 0c             	mov    0xc(%ebp),%eax
  1058f4:	89 44 24 04          	mov    %eax,0x4(%esp)
  1058f8:	8b 45 08             	mov    0x8(%ebp),%eax
  1058fb:	89 04 24             	mov    %eax,(%esp)
  1058fe:	e8 45 fe ff ff       	call   105748 <printfmt>
            break;
  105903:	e9 3d 02 00 00       	jmp    105b45 <vprintfmt+0x3cc>

        // string
        case 's':
            if ((p = va_arg(ap, char *)) == NULL) {
  105908:	8b 45 14             	mov    0x14(%ebp),%eax
  10590b:	8d 50 04             	lea    0x4(%eax),%edx
  10590e:	89 55 14             	mov    %edx,0x14(%ebp)
  105911:	8b 30                	mov    (%eax),%esi
  105913:	85 f6                	test   %esi,%esi
  105915:	75 05                	jne    10591c <vprintfmt+0x1a3>
                p = "(null)";
  105917:	be 81 72 10 00       	mov    $0x107281,%esi
            }
            if (width > 0 && padc != '-') {
  10591c:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
  105920:	7e 76                	jle    105998 <vprintfmt+0x21f>
  105922:	80 7d db 2d          	cmpb   $0x2d,-0x25(%ebp)
  105926:	74 70                	je     105998 <vprintfmt+0x21f>
                for (width -= strnlen(p, precision); width > 0; width --) {
  105928:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  10592b:	89 44 24 04          	mov    %eax,0x4(%esp)
  10592f:	89 34 24             	mov    %esi,(%esp)
  105932:	e8 16 03 00 00       	call   105c4d <strnlen>
  105937:	89 c2                	mov    %eax,%edx
  105939:	8b 45 e8             	mov    -0x18(%ebp),%eax
  10593c:	29 d0                	sub    %edx,%eax
  10593e:	89 45 e8             	mov    %eax,-0x18(%ebp)
  105941:	eb 16                	jmp    105959 <vprintfmt+0x1e0>
                    putch(padc, putdat);
  105943:	0f be 45 db          	movsbl -0x25(%ebp),%eax
  105947:	8b 55 0c             	mov    0xc(%ebp),%edx
  10594a:	89 54 24 04          	mov    %edx,0x4(%esp)
  10594e:	89 04 24             	mov    %eax,(%esp)
  105951:	8b 45 08             	mov    0x8(%ebp),%eax
  105954:	ff d0                	call   *%eax
                for (width -= strnlen(p, precision); width > 0; width --) {
  105956:	ff 4d e8             	decl   -0x18(%ebp)
  105959:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
  10595d:	7f e4                	jg     105943 <vprintfmt+0x1ca>
                }
            }
            for (; (ch = *p ++) != '\0' && (precision < 0 || -- precision >= 0); width --) {
  10595f:	eb 37                	jmp    105998 <vprintfmt+0x21f>
                if (altflag && (ch < ' ' || ch > '~')) {
  105961:	83 7d dc 00          	cmpl   $0x0,-0x24(%ebp)
  105965:	74 1f                	je     105986 <vprintfmt+0x20d>
  105967:	83 fb 1f             	cmp    $0x1f,%ebx
  10596a:	7e 05                	jle    105971 <vprintfmt+0x1f8>
  10596c:	83 fb 7e             	cmp    $0x7e,%ebx
  10596f:	7e 15                	jle    105986 <vprintfmt+0x20d>
                    putch('?', putdat);
  105971:	8b 45 0c             	mov    0xc(%ebp),%eax
  105974:	89 44 24 04          	mov    %eax,0x4(%esp)
  105978:	c7 04 24 3f 00 00 00 	movl   $0x3f,(%esp)
  10597f:	8b 45 08             	mov    0x8(%ebp),%eax
  105982:	ff d0                	call   *%eax
  105984:	eb 0f                	jmp    105995 <vprintfmt+0x21c>
                }
                else {
                    putch(ch, putdat);
  105986:	8b 45 0c             	mov    0xc(%ebp),%eax
  105989:	89 44 24 04          	mov    %eax,0x4(%esp)
  10598d:	89 1c 24             	mov    %ebx,(%esp)
  105990:	8b 45 08             	mov    0x8(%ebp),%eax
  105993:	ff d0                	call   *%eax
            for (; (ch = *p ++) != '\0' && (precision < 0 || -- precision >= 0); width --) {
  105995:	ff 4d e8             	decl   -0x18(%ebp)
  105998:	89 f0                	mov    %esi,%eax
  10599a:	8d 70 01             	lea    0x1(%eax),%esi
  10599d:	0f b6 00             	movzbl (%eax),%eax
  1059a0:	0f be d8             	movsbl %al,%ebx
  1059a3:	85 db                	test   %ebx,%ebx
  1059a5:	74 27                	je     1059ce <vprintfmt+0x255>
  1059a7:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
  1059ab:	78 b4                	js     105961 <vprintfmt+0x1e8>
  1059ad:	ff 4d e4             	decl   -0x1c(%ebp)
  1059b0:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
  1059b4:	79 ab                	jns    105961 <vprintfmt+0x1e8>
                }
            }
            for (; width > 0; width --) {
  1059b6:	eb 16                	jmp    1059ce <vprintfmt+0x255>
                putch(' ', putdat);
  1059b8:	8b 45 0c             	mov    0xc(%ebp),%eax
  1059bb:	89 44 24 04          	mov    %eax,0x4(%esp)
  1059bf:	c7 04 24 20 00 00 00 	movl   $0x20,(%esp)
  1059c6:	8b 45 08             	mov    0x8(%ebp),%eax
  1059c9:	ff d0                	call   *%eax
            for (; width > 0; width --) {
  1059cb:	ff 4d e8             	decl   -0x18(%ebp)
  1059ce:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
  1059d2:	7f e4                	jg     1059b8 <vprintfmt+0x23f>
            }
            break;
  1059d4:	e9 6c 01 00 00       	jmp    105b45 <vprintfmt+0x3cc>

        // (signed) decimal
        case 'd':
            num = getint(&ap, lflag);
  1059d9:	8b 45 e0             	mov    -0x20(%ebp),%eax
  1059dc:	89 44 24 04          	mov    %eax,0x4(%esp)
  1059e0:	8d 45 14             	lea    0x14(%ebp),%eax
  1059e3:	89 04 24             	mov    %eax,(%esp)
  1059e6:	e8 16 fd ff ff       	call   105701 <getint>
  1059eb:	89 45 f0             	mov    %eax,-0x10(%ebp)
  1059ee:	89 55 f4             	mov    %edx,-0xc(%ebp)
            if ((long long)num < 0) {
  1059f1:	8b 45 f0             	mov    -0x10(%ebp),%eax
  1059f4:	8b 55 f4             	mov    -0xc(%ebp),%edx
  1059f7:	85 d2                	test   %edx,%edx
  1059f9:	79 26                	jns    105a21 <vprintfmt+0x2a8>
                putch('-', putdat);
  1059fb:	8b 45 0c             	mov    0xc(%ebp),%eax
  1059fe:	89 44 24 04          	mov    %eax,0x4(%esp)
  105a02:	c7 04 24 2d 00 00 00 	movl   $0x2d,(%esp)
  105a09:	8b 45 08             	mov    0x8(%ebp),%eax
  105a0c:	ff d0                	call   *%eax
                num = -(long long)num;
  105a0e:	8b 45 f0             	mov    -0x10(%ebp),%eax
  105a11:	8b 55 f4             	mov    -0xc(%ebp),%edx
  105a14:	f7 d8                	neg    %eax
  105a16:	83 d2 00             	adc    $0x0,%edx
  105a19:	f7 da                	neg    %edx
  105a1b:	89 45 f0             	mov    %eax,-0x10(%ebp)
  105a1e:	89 55 f4             	mov    %edx,-0xc(%ebp)
            }
            base = 10;
  105a21:	c7 45 ec 0a 00 00 00 	movl   $0xa,-0x14(%ebp)
            goto number;
  105a28:	e9 a8 00 00 00       	jmp    105ad5 <vprintfmt+0x35c>

        // unsigned decimal
        case 'u':
            num = getuint(&ap, lflag);
  105a2d:	8b 45 e0             	mov    -0x20(%ebp),%eax
  105a30:	89 44 24 04          	mov    %eax,0x4(%esp)
  105a34:	8d 45 14             	lea    0x14(%ebp),%eax
  105a37:	89 04 24             	mov    %eax,(%esp)
  105a3a:	e8 73 fc ff ff       	call   1056b2 <getuint>
  105a3f:	89 45 f0             	mov    %eax,-0x10(%ebp)
  105a42:	89 55 f4             	mov    %edx,-0xc(%ebp)
            base = 10;
  105a45:	c7 45 ec 0a 00 00 00 	movl   $0xa,-0x14(%ebp)
            goto number;
  105a4c:	e9 84 00 00 00       	jmp    105ad5 <vprintfmt+0x35c>

        // (unsigned) octal
        case 'o':
            num = getuint(&ap, lflag);
  105a51:	8b 45 e0             	mov    -0x20(%ebp),%eax
  105a54:	89 44 24 04          	mov    %eax,0x4(%esp)
  105a58:	8d 45 14             	lea    0x14(%ebp),%eax
  105a5b:	89 04 24             	mov    %eax,(%esp)
  105a5e:	e8 4f fc ff ff       	call   1056b2 <getuint>
  105a63:	89 45 f0             	mov    %eax,-0x10(%ebp)
  105a66:	89 55 f4             	mov    %edx,-0xc(%ebp)
            base = 8;
  105a69:	c7 45 ec 08 00 00 00 	movl   $0x8,-0x14(%ebp)
            goto number;
  105a70:	eb 63                	jmp    105ad5 <vprintfmt+0x35c>

        // pointer
        case 'p':
            putch('0', putdat);
  105a72:	8b 45 0c             	mov    0xc(%ebp),%eax
  105a75:	89 44 24 04          	mov    %eax,0x4(%esp)
  105a79:	c7 04 24 30 00 00 00 	movl   $0x30,(%esp)
  105a80:	8b 45 08             	mov    0x8(%ebp),%eax
  105a83:	ff d0                	call   *%eax
            putch('x', putdat);
  105a85:	8b 45 0c             	mov    0xc(%ebp),%eax
  105a88:	89 44 24 04          	mov    %eax,0x4(%esp)
  105a8c:	c7 04 24 78 00 00 00 	movl   $0x78,(%esp)
  105a93:	8b 45 08             	mov    0x8(%ebp),%eax
  105a96:	ff d0                	call   *%eax
            num = (unsigned long long)(uintptr_t)va_arg(ap, void *);
  105a98:	8b 45 14             	mov    0x14(%ebp),%eax
  105a9b:	8d 50 04             	lea    0x4(%eax),%edx
  105a9e:	89 55 14             	mov    %edx,0x14(%ebp)
  105aa1:	8b 00                	mov    (%eax),%eax
  105aa3:	89 45 f0             	mov    %eax,-0x10(%ebp)
  105aa6:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
            base = 16;
  105aad:	c7 45 ec 10 00 00 00 	movl   $0x10,-0x14(%ebp)
            goto number;
  105ab4:	eb 1f                	jmp    105ad5 <vprintfmt+0x35c>

        // (unsigned) hexadecimal
        case 'x':
            num = getuint(&ap, lflag);
  105ab6:	8b 45 e0             	mov    -0x20(%ebp),%eax
  105ab9:	89 44 24 04          	mov    %eax,0x4(%esp)
  105abd:	8d 45 14             	lea    0x14(%ebp),%eax
  105ac0:	89 04 24             	mov    %eax,(%esp)
  105ac3:	e8 ea fb ff ff       	call   1056b2 <getuint>
  105ac8:	89 45 f0             	mov    %eax,-0x10(%ebp)
  105acb:	89 55 f4             	mov    %edx,-0xc(%ebp)
            base = 16;
  105ace:	c7 45 ec 10 00 00 00 	movl   $0x10,-0x14(%ebp)
        number:
            printnum(putch, putdat, num, base, width, padc);
  105ad5:	0f be 55 db          	movsbl -0x25(%ebp),%edx
  105ad9:	8b 45 ec             	mov    -0x14(%ebp),%eax
  105adc:	89 54 24 18          	mov    %edx,0x18(%esp)
  105ae0:	8b 55 e8             	mov    -0x18(%ebp),%edx
  105ae3:	89 54 24 14          	mov    %edx,0x14(%esp)
  105ae7:	89 44 24 10          	mov    %eax,0x10(%esp)
  105aeb:	8b 45 f0             	mov    -0x10(%ebp),%eax
  105aee:	8b 55 f4             	mov    -0xc(%ebp),%edx
  105af1:	89 44 24 08          	mov    %eax,0x8(%esp)
  105af5:	89 54 24 0c          	mov    %edx,0xc(%esp)
  105af9:	8b 45 0c             	mov    0xc(%ebp),%eax
  105afc:	89 44 24 04          	mov    %eax,0x4(%esp)
  105b00:	8b 45 08             	mov    0x8(%ebp),%eax
  105b03:	89 04 24             	mov    %eax,(%esp)
  105b06:	e8 a5 fa ff ff       	call   1055b0 <printnum>
            break;
  105b0b:	eb 38                	jmp    105b45 <vprintfmt+0x3cc>

        // escaped '%' character
        case '%':
            putch(ch, putdat);
  105b0d:	8b 45 0c             	mov    0xc(%ebp),%eax
  105b10:	89 44 24 04          	mov    %eax,0x4(%esp)
  105b14:	89 1c 24             	mov    %ebx,(%esp)
  105b17:	8b 45 08             	mov    0x8(%ebp),%eax
  105b1a:	ff d0                	call   *%eax
            break;
  105b1c:	eb 27                	jmp    105b45 <vprintfmt+0x3cc>

        // unrecognized escape sequence - just print it literally
        default:
            putch('%', putdat);
  105b1e:	8b 45 0c             	mov    0xc(%ebp),%eax
  105b21:	89 44 24 04          	mov    %eax,0x4(%esp)
  105b25:	c7 04 24 25 00 00 00 	movl   $0x25,(%esp)
  105b2c:	8b 45 08             	mov    0x8(%ebp),%eax
  105b2f:	ff d0                	call   *%eax
            for (fmt --; fmt[-1] != '%'; fmt --)
  105b31:	ff 4d 10             	decl   0x10(%ebp)
  105b34:	eb 03                	jmp    105b39 <vprintfmt+0x3c0>
  105b36:	ff 4d 10             	decl   0x10(%ebp)
  105b39:	8b 45 10             	mov    0x10(%ebp),%eax
  105b3c:	48                   	dec    %eax
  105b3d:	0f b6 00             	movzbl (%eax),%eax
  105b40:	3c 25                	cmp    $0x25,%al
  105b42:	75 f2                	jne    105b36 <vprintfmt+0x3bd>
                /* do nothing */;
            break;
  105b44:	90                   	nop
    while (1) {
  105b45:	e9 37 fc ff ff       	jmp    105781 <vprintfmt+0x8>
                return;
  105b4a:	90                   	nop
        }
    }
}
  105b4b:	83 c4 40             	add    $0x40,%esp
  105b4e:	5b                   	pop    %ebx
  105b4f:	5e                   	pop    %esi
  105b50:	5d                   	pop    %ebp
  105b51:	c3                   	ret    

00105b52 <sprintputch>:
 * sprintputch - 'print' a single character in a buffer
 * @ch:         the character will be printed
 * @b:          the buffer to place the character @ch
 * */
static void
sprintputch(int ch, struct sprintbuf *b) {
  105b52:	55                   	push   %ebp
  105b53:	89 e5                	mov    %esp,%ebp
    b->cnt ++;
  105b55:	8b 45 0c             	mov    0xc(%ebp),%eax
  105b58:	8b 40 08             	mov    0x8(%eax),%eax
  105b5b:	8d 50 01             	lea    0x1(%eax),%edx
  105b5e:	8b 45 0c             	mov    0xc(%ebp),%eax
  105b61:	89 50 08             	mov    %edx,0x8(%eax)
    if (b->buf < b->ebuf) {
  105b64:	8b 45 0c             	mov    0xc(%ebp),%eax
  105b67:	8b 10                	mov    (%eax),%edx
  105b69:	8b 45 0c             	mov    0xc(%ebp),%eax
  105b6c:	8b 40 04             	mov    0x4(%eax),%eax
  105b6f:	39 c2                	cmp    %eax,%edx
  105b71:	73 12                	jae    105b85 <sprintputch+0x33>
        *b->buf ++ = ch;
  105b73:	8b 45 0c             	mov    0xc(%ebp),%eax
  105b76:	8b 00                	mov    (%eax),%eax
  105b78:	8d 48 01             	lea    0x1(%eax),%ecx
  105b7b:	8b 55 0c             	mov    0xc(%ebp),%edx
  105b7e:	89 0a                	mov    %ecx,(%edx)
  105b80:	8b 55 08             	mov    0x8(%ebp),%edx
  105b83:	88 10                	mov    %dl,(%eax)
    }
}
  105b85:	90                   	nop
  105b86:	5d                   	pop    %ebp
  105b87:	c3                   	ret    

00105b88 <snprintf>:
 * @str:        the buffer to place the result into
 * @size:       the size of buffer, including the trailing null space
 * @fmt:        the format string to use
 * */
int
snprintf(char *str, size_t size, const char *fmt, ...) {
  105b88:	55                   	push   %ebp
  105b89:	89 e5                	mov    %esp,%ebp
  105b8b:	83 ec 28             	sub    $0x28,%esp
    va_list ap;
    int cnt;
    va_start(ap, fmt);
  105b8e:	8d 45 14             	lea    0x14(%ebp),%eax
  105b91:	89 45 f0             	mov    %eax,-0x10(%ebp)
    cnt = vsnprintf(str, size, fmt, ap);
  105b94:	8b 45 f0             	mov    -0x10(%ebp),%eax
  105b97:	89 44 24 0c          	mov    %eax,0xc(%esp)
  105b9b:	8b 45 10             	mov    0x10(%ebp),%eax
  105b9e:	89 44 24 08          	mov    %eax,0x8(%esp)
  105ba2:	8b 45 0c             	mov    0xc(%ebp),%eax
  105ba5:	89 44 24 04          	mov    %eax,0x4(%esp)
  105ba9:	8b 45 08             	mov    0x8(%ebp),%eax
  105bac:	89 04 24             	mov    %eax,(%esp)
  105baf:	e8 0a 00 00 00       	call   105bbe <vsnprintf>
  105bb4:	89 45 f4             	mov    %eax,-0xc(%ebp)
    va_end(ap);
    return cnt;
  105bb7:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
  105bba:	89 ec                	mov    %ebp,%esp
  105bbc:	5d                   	pop    %ebp
  105bbd:	c3                   	ret    

00105bbe <vsnprintf>:
 *
 * Call this function if you are already dealing with a va_list.
 * Or you probably want snprintf() instead.
 * */
int
vsnprintf(char *str, size_t size, const char *fmt, va_list ap) {
  105bbe:	55                   	push   %ebp
  105bbf:	89 e5                	mov    %esp,%ebp
  105bc1:	83 ec 28             	sub    $0x28,%esp
    struct sprintbuf b = {str, str + size - 1, 0};
  105bc4:	8b 45 08             	mov    0x8(%ebp),%eax
  105bc7:	89 45 ec             	mov    %eax,-0x14(%ebp)
  105bca:	8b 45 0c             	mov    0xc(%ebp),%eax
  105bcd:	8d 50 ff             	lea    -0x1(%eax),%edx
  105bd0:	8b 45 08             	mov    0x8(%ebp),%eax
  105bd3:	01 d0                	add    %edx,%eax
  105bd5:	89 45 f0             	mov    %eax,-0x10(%ebp)
  105bd8:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    if (str == NULL || b.buf > b.ebuf) {
  105bdf:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
  105be3:	74 0a                	je     105bef <vsnprintf+0x31>
  105be5:	8b 55 ec             	mov    -0x14(%ebp),%edx
  105be8:	8b 45 f0             	mov    -0x10(%ebp),%eax
  105beb:	39 c2                	cmp    %eax,%edx
  105bed:	76 07                	jbe    105bf6 <vsnprintf+0x38>
        return -E_INVAL;
  105bef:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  105bf4:	eb 2a                	jmp    105c20 <vsnprintf+0x62>
    }
    // print the string to the buffer
    vprintfmt((void*)sprintputch, &b, fmt, ap);
  105bf6:	8b 45 14             	mov    0x14(%ebp),%eax
  105bf9:	89 44 24 0c          	mov    %eax,0xc(%esp)
  105bfd:	8b 45 10             	mov    0x10(%ebp),%eax
  105c00:	89 44 24 08          	mov    %eax,0x8(%esp)
  105c04:	8d 45 ec             	lea    -0x14(%ebp),%eax
  105c07:	89 44 24 04          	mov    %eax,0x4(%esp)
  105c0b:	c7 04 24 52 5b 10 00 	movl   $0x105b52,(%esp)
  105c12:	e8 62 fb ff ff       	call   105779 <vprintfmt>
    // null terminate the buffer
    *b.buf = '\0';
  105c17:	8b 45 ec             	mov    -0x14(%ebp),%eax
  105c1a:	c6 00 00             	movb   $0x0,(%eax)
    return b.cnt;
  105c1d:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
  105c20:	89 ec                	mov    %ebp,%esp
  105c22:	5d                   	pop    %ebp
  105c23:	c3                   	ret    

00105c24 <strlen>:
 * @s:      the input string
 *
 * The strlen() function returns the length of string @s.
 * */
size_t
strlen(const char *s) {
  105c24:	55                   	push   %ebp
  105c25:	89 e5                	mov    %esp,%ebp
  105c27:	83 ec 10             	sub    $0x10,%esp
    size_t cnt = 0;
  105c2a:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
    while (*s ++ != '\0') {
  105c31:	eb 03                	jmp    105c36 <strlen+0x12>
        cnt ++;
  105c33:	ff 45 fc             	incl   -0x4(%ebp)
    while (*s ++ != '\0') {
  105c36:	8b 45 08             	mov    0x8(%ebp),%eax
  105c39:	8d 50 01             	lea    0x1(%eax),%edx
  105c3c:	89 55 08             	mov    %edx,0x8(%ebp)
  105c3f:	0f b6 00             	movzbl (%eax),%eax
  105c42:	84 c0                	test   %al,%al
  105c44:	75 ed                	jne    105c33 <strlen+0xf>
    }
    return cnt;
  105c46:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
  105c49:	89 ec                	mov    %ebp,%esp
  105c4b:	5d                   	pop    %ebp
  105c4c:	c3                   	ret    

00105c4d <strnlen>:
 * The return value is strlen(s), if that is less than @len, or
 * @len if there is no '\0' character among the first @len characters
 * pointed by @s.
 * */
size_t
strnlen(const char *s, size_t len) {
  105c4d:	55                   	push   %ebp
  105c4e:	89 e5                	mov    %esp,%ebp
  105c50:	83 ec 10             	sub    $0x10,%esp
    size_t cnt = 0;
  105c53:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
    while (cnt < len && *s ++ != '\0') {
  105c5a:	eb 03                	jmp    105c5f <strnlen+0x12>
        cnt ++;
  105c5c:	ff 45 fc             	incl   -0x4(%ebp)
    while (cnt < len && *s ++ != '\0') {
  105c5f:	8b 45 fc             	mov    -0x4(%ebp),%eax
  105c62:	3b 45 0c             	cmp    0xc(%ebp),%eax
  105c65:	73 10                	jae    105c77 <strnlen+0x2a>
  105c67:	8b 45 08             	mov    0x8(%ebp),%eax
  105c6a:	8d 50 01             	lea    0x1(%eax),%edx
  105c6d:	89 55 08             	mov    %edx,0x8(%ebp)
  105c70:	0f b6 00             	movzbl (%eax),%eax
  105c73:	84 c0                	test   %al,%al
  105c75:	75 e5                	jne    105c5c <strnlen+0xf>
    }
    return cnt;
  105c77:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
  105c7a:	89 ec                	mov    %ebp,%esp
  105c7c:	5d                   	pop    %ebp
  105c7d:	c3                   	ret    

00105c7e <strcpy>:
 * To avoid overflows, the size of array pointed by @dst should be long enough to
 * contain the same string as @src (including the terminating null character), and
 * should not overlap in memory with @src.
 * */
char *
strcpy(char *dst, const char *src) {
  105c7e:	55                   	push   %ebp
  105c7f:	89 e5                	mov    %esp,%ebp
  105c81:	57                   	push   %edi
  105c82:	56                   	push   %esi
  105c83:	83 ec 20             	sub    $0x20,%esp
  105c86:	8b 45 08             	mov    0x8(%ebp),%eax
  105c89:	89 45 f4             	mov    %eax,-0xc(%ebp)
  105c8c:	8b 45 0c             	mov    0xc(%ebp),%eax
  105c8f:	89 45 f0             	mov    %eax,-0x10(%ebp)
#ifndef __HAVE_ARCH_STRCPY
#define __HAVE_ARCH_STRCPY
static inline char *
__strcpy(char *dst, const char *src) {
    int d0, d1, d2;
    asm volatile (
  105c92:	8b 55 f0             	mov    -0x10(%ebp),%edx
  105c95:	8b 45 f4             	mov    -0xc(%ebp),%eax
  105c98:	89 d1                	mov    %edx,%ecx
  105c9a:	89 c2                	mov    %eax,%edx
  105c9c:	89 ce                	mov    %ecx,%esi
  105c9e:	89 d7                	mov    %edx,%edi
  105ca0:	ac                   	lods   %ds:(%esi),%al
  105ca1:	aa                   	stos   %al,%es:(%edi)
  105ca2:	84 c0                	test   %al,%al
  105ca4:	75 fa                	jne    105ca0 <strcpy+0x22>
  105ca6:	89 fa                	mov    %edi,%edx
  105ca8:	89 f1                	mov    %esi,%ecx
  105caa:	89 4d ec             	mov    %ecx,-0x14(%ebp)
  105cad:	89 55 e8             	mov    %edx,-0x18(%ebp)
  105cb0:	89 45 e4             	mov    %eax,-0x1c(%ebp)
        "stosb;"
        "testb %%al, %%al;"
        "jne 1b;"
        : "=&S" (d0), "=&D" (d1), "=&a" (d2)
        : "0" (src), "1" (dst) : "memory");
    return dst;
  105cb3:	8b 45 f4             	mov    -0xc(%ebp),%eax
    char *p = dst;
    while ((*p ++ = *src ++) != '\0')
        /* nothing */;
    return dst;
#endif /* __HAVE_ARCH_STRCPY */
}
  105cb6:	83 c4 20             	add    $0x20,%esp
  105cb9:	5e                   	pop    %esi
  105cba:	5f                   	pop    %edi
  105cbb:	5d                   	pop    %ebp
  105cbc:	c3                   	ret    

00105cbd <strncpy>:
 * @len:    maximum number of characters to be copied from @src
 *
 * The return value is @dst
 * */
char *
strncpy(char *dst, const char *src, size_t len) {
  105cbd:	55                   	push   %ebp
  105cbe:	89 e5                	mov    %esp,%ebp
  105cc0:	83 ec 10             	sub    $0x10,%esp
    char *p = dst;
  105cc3:	8b 45 08             	mov    0x8(%ebp),%eax
  105cc6:	89 45 fc             	mov    %eax,-0x4(%ebp)
    while (len > 0) {
  105cc9:	eb 1e                	jmp    105ce9 <strncpy+0x2c>
        if ((*p = *src) != '\0') {
  105ccb:	8b 45 0c             	mov    0xc(%ebp),%eax
  105cce:	0f b6 10             	movzbl (%eax),%edx
  105cd1:	8b 45 fc             	mov    -0x4(%ebp),%eax
  105cd4:	88 10                	mov    %dl,(%eax)
  105cd6:	8b 45 fc             	mov    -0x4(%ebp),%eax
  105cd9:	0f b6 00             	movzbl (%eax),%eax
  105cdc:	84 c0                	test   %al,%al
  105cde:	74 03                	je     105ce3 <strncpy+0x26>
            src ++;
  105ce0:	ff 45 0c             	incl   0xc(%ebp)
        }
        p ++, len --;
  105ce3:	ff 45 fc             	incl   -0x4(%ebp)
  105ce6:	ff 4d 10             	decl   0x10(%ebp)
    while (len > 0) {
  105ce9:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
  105ced:	75 dc                	jne    105ccb <strncpy+0xe>
    }
    return dst;
  105cef:	8b 45 08             	mov    0x8(%ebp),%eax
}
  105cf2:	89 ec                	mov    %ebp,%esp
  105cf4:	5d                   	pop    %ebp
  105cf5:	c3                   	ret    

00105cf6 <strcmp>:
 * - A value greater than zero indicates that the first character that does
 *   not match has a greater value in @s1 than in @s2;
 * - And a value less than zero indicates the opposite.
 * */
int
strcmp(const char *s1, const char *s2) {
  105cf6:	55                   	push   %ebp
  105cf7:	89 e5                	mov    %esp,%ebp
  105cf9:	57                   	push   %edi
  105cfa:	56                   	push   %esi
  105cfb:	83 ec 20             	sub    $0x20,%esp
  105cfe:	8b 45 08             	mov    0x8(%ebp),%eax
  105d01:	89 45 f4             	mov    %eax,-0xc(%ebp)
  105d04:	8b 45 0c             	mov    0xc(%ebp),%eax
  105d07:	89 45 f0             	mov    %eax,-0x10(%ebp)
    asm volatile (
  105d0a:	8b 55 f4             	mov    -0xc(%ebp),%edx
  105d0d:	8b 45 f0             	mov    -0x10(%ebp),%eax
  105d10:	89 d1                	mov    %edx,%ecx
  105d12:	89 c2                	mov    %eax,%edx
  105d14:	89 ce                	mov    %ecx,%esi
  105d16:	89 d7                	mov    %edx,%edi
  105d18:	ac                   	lods   %ds:(%esi),%al
  105d19:	ae                   	scas   %es:(%edi),%al
  105d1a:	75 08                	jne    105d24 <strcmp+0x2e>
  105d1c:	84 c0                	test   %al,%al
  105d1e:	75 f8                	jne    105d18 <strcmp+0x22>
  105d20:	31 c0                	xor    %eax,%eax
  105d22:	eb 04                	jmp    105d28 <strcmp+0x32>
  105d24:	19 c0                	sbb    %eax,%eax
  105d26:	0c 01                	or     $0x1,%al
  105d28:	89 fa                	mov    %edi,%edx
  105d2a:	89 f1                	mov    %esi,%ecx
  105d2c:	89 45 ec             	mov    %eax,-0x14(%ebp)
  105d2f:	89 4d e8             	mov    %ecx,-0x18(%ebp)
  105d32:	89 55 e4             	mov    %edx,-0x1c(%ebp)
    return ret;
  105d35:	8b 45 ec             	mov    -0x14(%ebp),%eax
    while (*s1 != '\0' && *s1 == *s2) {
        s1 ++, s2 ++;
    }
    return (int)((unsigned char)*s1 - (unsigned char)*s2);
#endif /* __HAVE_ARCH_STRCMP */
}
  105d38:	83 c4 20             	add    $0x20,%esp
  105d3b:	5e                   	pop    %esi
  105d3c:	5f                   	pop    %edi
  105d3d:	5d                   	pop    %ebp
  105d3e:	c3                   	ret    

00105d3f <strncmp>:
 * they are equal to each other, it continues with the following pairs until
 * the characters differ, until a terminating null-character is reached, or
 * until @n characters match in both strings, whichever happens first.
 * */
int
strncmp(const char *s1, const char *s2, size_t n) {
  105d3f:	55                   	push   %ebp
  105d40:	89 e5                	mov    %esp,%ebp
    while (n > 0 && *s1 != '\0' && *s1 == *s2) {
  105d42:	eb 09                	jmp    105d4d <strncmp+0xe>
        n --, s1 ++, s2 ++;
  105d44:	ff 4d 10             	decl   0x10(%ebp)
  105d47:	ff 45 08             	incl   0x8(%ebp)
  105d4a:	ff 45 0c             	incl   0xc(%ebp)
    while (n > 0 && *s1 != '\0' && *s1 == *s2) {
  105d4d:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
  105d51:	74 1a                	je     105d6d <strncmp+0x2e>
  105d53:	8b 45 08             	mov    0x8(%ebp),%eax
  105d56:	0f b6 00             	movzbl (%eax),%eax
  105d59:	84 c0                	test   %al,%al
  105d5b:	74 10                	je     105d6d <strncmp+0x2e>
  105d5d:	8b 45 08             	mov    0x8(%ebp),%eax
  105d60:	0f b6 10             	movzbl (%eax),%edx
  105d63:	8b 45 0c             	mov    0xc(%ebp),%eax
  105d66:	0f b6 00             	movzbl (%eax),%eax
  105d69:	38 c2                	cmp    %al,%dl
  105d6b:	74 d7                	je     105d44 <strncmp+0x5>
    }
    return (n == 0) ? 0 : (int)((unsigned char)*s1 - (unsigned char)*s2);
  105d6d:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
  105d71:	74 18                	je     105d8b <strncmp+0x4c>
  105d73:	8b 45 08             	mov    0x8(%ebp),%eax
  105d76:	0f b6 00             	movzbl (%eax),%eax
  105d79:	0f b6 d0             	movzbl %al,%edx
  105d7c:	8b 45 0c             	mov    0xc(%ebp),%eax
  105d7f:	0f b6 00             	movzbl (%eax),%eax
  105d82:	0f b6 c8             	movzbl %al,%ecx
  105d85:	89 d0                	mov    %edx,%eax
  105d87:	29 c8                	sub    %ecx,%eax
  105d89:	eb 05                	jmp    105d90 <strncmp+0x51>
  105d8b:	b8 00 00 00 00       	mov    $0x0,%eax
}
  105d90:	5d                   	pop    %ebp
  105d91:	c3                   	ret    

00105d92 <strchr>:
 *
 * The strchr() function returns a pointer to the first occurrence of
 * character in @s. If the value is not found, the function returns 'NULL'.
 * */
char *
strchr(const char *s, char c) {
  105d92:	55                   	push   %ebp
  105d93:	89 e5                	mov    %esp,%ebp
  105d95:	83 ec 04             	sub    $0x4,%esp
  105d98:	8b 45 0c             	mov    0xc(%ebp),%eax
  105d9b:	88 45 fc             	mov    %al,-0x4(%ebp)
    while (*s != '\0') {
  105d9e:	eb 13                	jmp    105db3 <strchr+0x21>
        if (*s == c) {
  105da0:	8b 45 08             	mov    0x8(%ebp),%eax
  105da3:	0f b6 00             	movzbl (%eax),%eax
  105da6:	38 45 fc             	cmp    %al,-0x4(%ebp)
  105da9:	75 05                	jne    105db0 <strchr+0x1e>
            return (char *)s;
  105dab:	8b 45 08             	mov    0x8(%ebp),%eax
  105dae:	eb 12                	jmp    105dc2 <strchr+0x30>
        }
        s ++;
  105db0:	ff 45 08             	incl   0x8(%ebp)
    while (*s != '\0') {
  105db3:	8b 45 08             	mov    0x8(%ebp),%eax
  105db6:	0f b6 00             	movzbl (%eax),%eax
  105db9:	84 c0                	test   %al,%al
  105dbb:	75 e3                	jne    105da0 <strchr+0xe>
    }
    return NULL;
  105dbd:	b8 00 00 00 00       	mov    $0x0,%eax
}
  105dc2:	89 ec                	mov    %ebp,%esp
  105dc4:	5d                   	pop    %ebp
  105dc5:	c3                   	ret    

00105dc6 <strfind>:
 * The strfind() function is like strchr() except that if @c is
 * not found in @s, then it returns a pointer to the null byte at the
 * end of @s, rather than 'NULL'.
 * */
char *
strfind(const char *s, char c) {
  105dc6:	55                   	push   %ebp
  105dc7:	89 e5                	mov    %esp,%ebp
  105dc9:	83 ec 04             	sub    $0x4,%esp
  105dcc:	8b 45 0c             	mov    0xc(%ebp),%eax
  105dcf:	88 45 fc             	mov    %al,-0x4(%ebp)
    while (*s != '\0') {
  105dd2:	eb 0e                	jmp    105de2 <strfind+0x1c>
        if (*s == c) {
  105dd4:	8b 45 08             	mov    0x8(%ebp),%eax
  105dd7:	0f b6 00             	movzbl (%eax),%eax
  105dda:	38 45 fc             	cmp    %al,-0x4(%ebp)
  105ddd:	74 0f                	je     105dee <strfind+0x28>
            break;
        }
        s ++;
  105ddf:	ff 45 08             	incl   0x8(%ebp)
    while (*s != '\0') {
  105de2:	8b 45 08             	mov    0x8(%ebp),%eax
  105de5:	0f b6 00             	movzbl (%eax),%eax
  105de8:	84 c0                	test   %al,%al
  105dea:	75 e8                	jne    105dd4 <strfind+0xe>
  105dec:	eb 01                	jmp    105def <strfind+0x29>
            break;
  105dee:	90                   	nop
    }
    return (char *)s;
  105def:	8b 45 08             	mov    0x8(%ebp),%eax
}
  105df2:	89 ec                	mov    %ebp,%esp
  105df4:	5d                   	pop    %ebp
  105df5:	c3                   	ret    

00105df6 <strtol>:
 * an optional "0x" or "0X" prefix.
 *
 * The strtol() function returns the converted integral number as a long int value.
 * */
long
strtol(const char *s, char **endptr, int base) {
  105df6:	55                   	push   %ebp
  105df7:	89 e5                	mov    %esp,%ebp
  105df9:	83 ec 10             	sub    $0x10,%esp
    int neg = 0;
  105dfc:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
    long val = 0;
  105e03:	c7 45 f8 00 00 00 00 	movl   $0x0,-0x8(%ebp)

    // gobble initial whitespace
    while (*s == ' ' || *s == '\t') {
  105e0a:	eb 03                	jmp    105e0f <strtol+0x19>
        s ++;
  105e0c:	ff 45 08             	incl   0x8(%ebp)
    while (*s == ' ' || *s == '\t') {
  105e0f:	8b 45 08             	mov    0x8(%ebp),%eax
  105e12:	0f b6 00             	movzbl (%eax),%eax
  105e15:	3c 20                	cmp    $0x20,%al
  105e17:	74 f3                	je     105e0c <strtol+0x16>
  105e19:	8b 45 08             	mov    0x8(%ebp),%eax
  105e1c:	0f b6 00             	movzbl (%eax),%eax
  105e1f:	3c 09                	cmp    $0x9,%al
  105e21:	74 e9                	je     105e0c <strtol+0x16>
    }

    // plus/minus sign
    if (*s == '+') {
  105e23:	8b 45 08             	mov    0x8(%ebp),%eax
  105e26:	0f b6 00             	movzbl (%eax),%eax
  105e29:	3c 2b                	cmp    $0x2b,%al
  105e2b:	75 05                	jne    105e32 <strtol+0x3c>
        s ++;
  105e2d:	ff 45 08             	incl   0x8(%ebp)
  105e30:	eb 14                	jmp    105e46 <strtol+0x50>
    }
    else if (*s == '-') {
  105e32:	8b 45 08             	mov    0x8(%ebp),%eax
  105e35:	0f b6 00             	movzbl (%eax),%eax
  105e38:	3c 2d                	cmp    $0x2d,%al
  105e3a:	75 0a                	jne    105e46 <strtol+0x50>
        s ++, neg = 1;
  105e3c:	ff 45 08             	incl   0x8(%ebp)
  105e3f:	c7 45 fc 01 00 00 00 	movl   $0x1,-0x4(%ebp)
    }

    // hex or octal base prefix
    if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x')) {
  105e46:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
  105e4a:	74 06                	je     105e52 <strtol+0x5c>
  105e4c:	83 7d 10 10          	cmpl   $0x10,0x10(%ebp)
  105e50:	75 22                	jne    105e74 <strtol+0x7e>
  105e52:	8b 45 08             	mov    0x8(%ebp),%eax
  105e55:	0f b6 00             	movzbl (%eax),%eax
  105e58:	3c 30                	cmp    $0x30,%al
  105e5a:	75 18                	jne    105e74 <strtol+0x7e>
  105e5c:	8b 45 08             	mov    0x8(%ebp),%eax
  105e5f:	40                   	inc    %eax
  105e60:	0f b6 00             	movzbl (%eax),%eax
  105e63:	3c 78                	cmp    $0x78,%al
  105e65:	75 0d                	jne    105e74 <strtol+0x7e>
        s += 2, base = 16;
  105e67:	83 45 08 02          	addl   $0x2,0x8(%ebp)
  105e6b:	c7 45 10 10 00 00 00 	movl   $0x10,0x10(%ebp)
  105e72:	eb 29                	jmp    105e9d <strtol+0xa7>
    }
    else if (base == 0 && s[0] == '0') {
  105e74:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
  105e78:	75 16                	jne    105e90 <strtol+0x9a>
  105e7a:	8b 45 08             	mov    0x8(%ebp),%eax
  105e7d:	0f b6 00             	movzbl (%eax),%eax
  105e80:	3c 30                	cmp    $0x30,%al
  105e82:	75 0c                	jne    105e90 <strtol+0x9a>
        s ++, base = 8;
  105e84:	ff 45 08             	incl   0x8(%ebp)
  105e87:	c7 45 10 08 00 00 00 	movl   $0x8,0x10(%ebp)
  105e8e:	eb 0d                	jmp    105e9d <strtol+0xa7>
    }
    else if (base == 0) {
  105e90:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
  105e94:	75 07                	jne    105e9d <strtol+0xa7>
        base = 10;
  105e96:	c7 45 10 0a 00 00 00 	movl   $0xa,0x10(%ebp)

    // digits
    while (1) {
        int dig;

        if (*s >= '0' && *s <= '9') {
  105e9d:	8b 45 08             	mov    0x8(%ebp),%eax
  105ea0:	0f b6 00             	movzbl (%eax),%eax
  105ea3:	3c 2f                	cmp    $0x2f,%al
  105ea5:	7e 1b                	jle    105ec2 <strtol+0xcc>
  105ea7:	8b 45 08             	mov    0x8(%ebp),%eax
  105eaa:	0f b6 00             	movzbl (%eax),%eax
  105ead:	3c 39                	cmp    $0x39,%al
  105eaf:	7f 11                	jg     105ec2 <strtol+0xcc>
            dig = *s - '0';
  105eb1:	8b 45 08             	mov    0x8(%ebp),%eax
  105eb4:	0f b6 00             	movzbl (%eax),%eax
  105eb7:	0f be c0             	movsbl %al,%eax
  105eba:	83 e8 30             	sub    $0x30,%eax
  105ebd:	89 45 f4             	mov    %eax,-0xc(%ebp)
  105ec0:	eb 48                	jmp    105f0a <strtol+0x114>
        }
        else if (*s >= 'a' && *s <= 'z') {
  105ec2:	8b 45 08             	mov    0x8(%ebp),%eax
  105ec5:	0f b6 00             	movzbl (%eax),%eax
  105ec8:	3c 60                	cmp    $0x60,%al
  105eca:	7e 1b                	jle    105ee7 <strtol+0xf1>
  105ecc:	8b 45 08             	mov    0x8(%ebp),%eax
  105ecf:	0f b6 00             	movzbl (%eax),%eax
  105ed2:	3c 7a                	cmp    $0x7a,%al
  105ed4:	7f 11                	jg     105ee7 <strtol+0xf1>
            dig = *s - 'a' + 10;
  105ed6:	8b 45 08             	mov    0x8(%ebp),%eax
  105ed9:	0f b6 00             	movzbl (%eax),%eax
  105edc:	0f be c0             	movsbl %al,%eax
  105edf:	83 e8 57             	sub    $0x57,%eax
  105ee2:	89 45 f4             	mov    %eax,-0xc(%ebp)
  105ee5:	eb 23                	jmp    105f0a <strtol+0x114>
        }
        else if (*s >= 'A' && *s <= 'Z') {
  105ee7:	8b 45 08             	mov    0x8(%ebp),%eax
  105eea:	0f b6 00             	movzbl (%eax),%eax
  105eed:	3c 40                	cmp    $0x40,%al
  105eef:	7e 3b                	jle    105f2c <strtol+0x136>
  105ef1:	8b 45 08             	mov    0x8(%ebp),%eax
  105ef4:	0f b6 00             	movzbl (%eax),%eax
  105ef7:	3c 5a                	cmp    $0x5a,%al
  105ef9:	7f 31                	jg     105f2c <strtol+0x136>
            dig = *s - 'A' + 10;
  105efb:	8b 45 08             	mov    0x8(%ebp),%eax
  105efe:	0f b6 00             	movzbl (%eax),%eax
  105f01:	0f be c0             	movsbl %al,%eax
  105f04:	83 e8 37             	sub    $0x37,%eax
  105f07:	89 45 f4             	mov    %eax,-0xc(%ebp)
        }
        else {
            break;
        }
        if (dig >= base) {
  105f0a:	8b 45 f4             	mov    -0xc(%ebp),%eax
  105f0d:	3b 45 10             	cmp    0x10(%ebp),%eax
  105f10:	7d 19                	jge    105f2b <strtol+0x135>
            break;
        }
        s ++, val = (val * base) + dig;
  105f12:	ff 45 08             	incl   0x8(%ebp)
  105f15:	8b 45 f8             	mov    -0x8(%ebp),%eax
  105f18:	0f af 45 10          	imul   0x10(%ebp),%eax
  105f1c:	89 c2                	mov    %eax,%edx
  105f1e:	8b 45 f4             	mov    -0xc(%ebp),%eax
  105f21:	01 d0                	add    %edx,%eax
  105f23:	89 45 f8             	mov    %eax,-0x8(%ebp)
    while (1) {
  105f26:	e9 72 ff ff ff       	jmp    105e9d <strtol+0xa7>
            break;
  105f2b:	90                   	nop
        // we don't properly detect overflow!
    }

    if (endptr) {
  105f2c:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
  105f30:	74 08                	je     105f3a <strtol+0x144>
        *endptr = (char *) s;
  105f32:	8b 45 0c             	mov    0xc(%ebp),%eax
  105f35:	8b 55 08             	mov    0x8(%ebp),%edx
  105f38:	89 10                	mov    %edx,(%eax)
    }
    return (neg ? -val : val);
  105f3a:	83 7d fc 00          	cmpl   $0x0,-0x4(%ebp)
  105f3e:	74 07                	je     105f47 <strtol+0x151>
  105f40:	8b 45 f8             	mov    -0x8(%ebp),%eax
  105f43:	f7 d8                	neg    %eax
  105f45:	eb 03                	jmp    105f4a <strtol+0x154>
  105f47:	8b 45 f8             	mov    -0x8(%ebp),%eax
}
  105f4a:	89 ec                	mov    %ebp,%esp
  105f4c:	5d                   	pop    %ebp
  105f4d:	c3                   	ret    

00105f4e <memset>:
 * @n:      number of bytes to be set to the value
 *
 * The memset() function returns @s.
 * */
void *
memset(void *s, char c, size_t n) {
  105f4e:	55                   	push   %ebp
  105f4f:	89 e5                	mov    %esp,%ebp
  105f51:	83 ec 28             	sub    $0x28,%esp
  105f54:	89 7d fc             	mov    %edi,-0x4(%ebp)
  105f57:	8b 45 0c             	mov    0xc(%ebp),%eax
  105f5a:	88 45 d8             	mov    %al,-0x28(%ebp)
#ifdef __HAVE_ARCH_MEMSET
    return __memset(s, c, n);
  105f5d:	0f be 55 d8          	movsbl -0x28(%ebp),%edx
  105f61:	8b 45 08             	mov    0x8(%ebp),%eax
  105f64:	89 45 f8             	mov    %eax,-0x8(%ebp)
  105f67:	88 55 f7             	mov    %dl,-0x9(%ebp)
  105f6a:	8b 45 10             	mov    0x10(%ebp),%eax
  105f6d:	89 45 f0             	mov    %eax,-0x10(%ebp)
#ifndef __HAVE_ARCH_MEMSET
#define __HAVE_ARCH_MEMSET
static inline void *
__memset(void *s, char c, size_t n) {
    int d0, d1;
    asm volatile (
  105f70:	8b 4d f0             	mov    -0x10(%ebp),%ecx
  105f73:	0f b6 45 f7          	movzbl -0x9(%ebp),%eax
  105f77:	8b 55 f8             	mov    -0x8(%ebp),%edx
  105f7a:	89 d7                	mov    %edx,%edi
  105f7c:	f3 aa                	rep stos %al,%es:(%edi)
  105f7e:	89 fa                	mov    %edi,%edx
  105f80:	89 4d ec             	mov    %ecx,-0x14(%ebp)
  105f83:	89 55 e8             	mov    %edx,-0x18(%ebp)
        "rep; stosb;"
        : "=&c" (d0), "=&D" (d1)
        : "0" (n), "a" (c), "1" (s)
        : "memory");
    return s;
  105f86:	8b 45 f8             	mov    -0x8(%ebp),%eax
    while (n -- > 0) {
        *p ++ = c;
    }
    return s;
#endif /* __HAVE_ARCH_MEMSET */
}
  105f89:	8b 7d fc             	mov    -0x4(%ebp),%edi
  105f8c:	89 ec                	mov    %ebp,%esp
  105f8e:	5d                   	pop    %ebp
  105f8f:	c3                   	ret    

00105f90 <memmove>:
 * @n:      number of bytes to copy
 *
 * The memmove() function returns @dst.
 * */
void *
memmove(void *dst, const void *src, size_t n) {
  105f90:	55                   	push   %ebp
  105f91:	89 e5                	mov    %esp,%ebp
  105f93:	57                   	push   %edi
  105f94:	56                   	push   %esi
  105f95:	53                   	push   %ebx
  105f96:	83 ec 30             	sub    $0x30,%esp
  105f99:	8b 45 08             	mov    0x8(%ebp),%eax
  105f9c:	89 45 f0             	mov    %eax,-0x10(%ebp)
  105f9f:	8b 45 0c             	mov    0xc(%ebp),%eax
  105fa2:	89 45 ec             	mov    %eax,-0x14(%ebp)
  105fa5:	8b 45 10             	mov    0x10(%ebp),%eax
  105fa8:	89 45 e8             	mov    %eax,-0x18(%ebp)

#ifndef __HAVE_ARCH_MEMMOVE
#define __HAVE_ARCH_MEMMOVE
static inline void *
__memmove(void *dst, const void *src, size_t n) {
    if (dst < src) {
  105fab:	8b 45 f0             	mov    -0x10(%ebp),%eax
  105fae:	3b 45 ec             	cmp    -0x14(%ebp),%eax
  105fb1:	73 42                	jae    105ff5 <memmove+0x65>
  105fb3:	8b 45 f0             	mov    -0x10(%ebp),%eax
  105fb6:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  105fb9:	8b 45 ec             	mov    -0x14(%ebp),%eax
  105fbc:	89 45 e0             	mov    %eax,-0x20(%ebp)
  105fbf:	8b 45 e8             	mov    -0x18(%ebp),%eax
  105fc2:	89 45 dc             	mov    %eax,-0x24(%ebp)
        "andl $3, %%ecx;"
        "jz 1f;"
        "rep; movsb;"
        "1:"
        : "=&c" (d0), "=&D" (d1), "=&S" (d2)
        : "0" (n / 4), "g" (n), "1" (dst), "2" (src)
  105fc5:	8b 45 dc             	mov    -0x24(%ebp),%eax
  105fc8:	c1 e8 02             	shr    $0x2,%eax
  105fcb:	89 c1                	mov    %eax,%ecx
    asm volatile (
  105fcd:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  105fd0:	8b 45 e0             	mov    -0x20(%ebp),%eax
  105fd3:	89 d7                	mov    %edx,%edi
  105fd5:	89 c6                	mov    %eax,%esi
  105fd7:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
  105fd9:	8b 4d dc             	mov    -0x24(%ebp),%ecx
  105fdc:	83 e1 03             	and    $0x3,%ecx
  105fdf:	74 02                	je     105fe3 <memmove+0x53>
  105fe1:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
  105fe3:	89 f0                	mov    %esi,%eax
  105fe5:	89 fa                	mov    %edi,%edx
  105fe7:	89 4d d8             	mov    %ecx,-0x28(%ebp)
  105fea:	89 55 d4             	mov    %edx,-0x2c(%ebp)
  105fed:	89 45 d0             	mov    %eax,-0x30(%ebp)
        : "memory");
    return dst;
  105ff0:	8b 45 e4             	mov    -0x1c(%ebp),%eax
        return __memcpy(dst, src, n);
  105ff3:	eb 36                	jmp    10602b <memmove+0x9b>
        : "0" (n), "1" (n - 1 + src), "2" (n - 1 + dst)
  105ff5:	8b 45 e8             	mov    -0x18(%ebp),%eax
  105ff8:	8d 50 ff             	lea    -0x1(%eax),%edx
  105ffb:	8b 45 ec             	mov    -0x14(%ebp),%eax
  105ffe:	01 c2                	add    %eax,%edx
  106000:	8b 45 e8             	mov    -0x18(%ebp),%eax
  106003:	8d 48 ff             	lea    -0x1(%eax),%ecx
  106006:	8b 45 f0             	mov    -0x10(%ebp),%eax
  106009:	8d 1c 01             	lea    (%ecx,%eax,1),%ebx
    asm volatile (
  10600c:	8b 45 e8             	mov    -0x18(%ebp),%eax
  10600f:	89 c1                	mov    %eax,%ecx
  106011:	89 d8                	mov    %ebx,%eax
  106013:	89 d6                	mov    %edx,%esi
  106015:	89 c7                	mov    %eax,%edi
  106017:	fd                   	std    
  106018:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
  10601a:	fc                   	cld    
  10601b:	89 f8                	mov    %edi,%eax
  10601d:	89 f2                	mov    %esi,%edx
  10601f:	89 4d cc             	mov    %ecx,-0x34(%ebp)
  106022:	89 55 c8             	mov    %edx,-0x38(%ebp)
  106025:	89 45 c4             	mov    %eax,-0x3c(%ebp)
    return dst;
  106028:	8b 45 f0             	mov    -0x10(%ebp),%eax
            *d ++ = *s ++;
        }
    }
    return dst;
#endif /* __HAVE_ARCH_MEMMOVE */
}
  10602b:	83 c4 30             	add    $0x30,%esp
  10602e:	5b                   	pop    %ebx
  10602f:	5e                   	pop    %esi
  106030:	5f                   	pop    %edi
  106031:	5d                   	pop    %ebp
  106032:	c3                   	ret    

00106033 <memcpy>:
 * it always copies exactly @n bytes. To avoid overflows, the size of arrays pointed
 * by both @src and @dst, should be at least @n bytes, and should not overlap
 * (for overlapping memory area, memmove is a safer approach).
 * */
void *
memcpy(void *dst, const void *src, size_t n) {
  106033:	55                   	push   %ebp
  106034:	89 e5                	mov    %esp,%ebp
  106036:	57                   	push   %edi
  106037:	56                   	push   %esi
  106038:	83 ec 20             	sub    $0x20,%esp
  10603b:	8b 45 08             	mov    0x8(%ebp),%eax
  10603e:	89 45 f4             	mov    %eax,-0xc(%ebp)
  106041:	8b 45 0c             	mov    0xc(%ebp),%eax
  106044:	89 45 f0             	mov    %eax,-0x10(%ebp)
  106047:	8b 45 10             	mov    0x10(%ebp),%eax
  10604a:	89 45 ec             	mov    %eax,-0x14(%ebp)
        : "0" (n / 4), "g" (n), "1" (dst), "2" (src)
  10604d:	8b 45 ec             	mov    -0x14(%ebp),%eax
  106050:	c1 e8 02             	shr    $0x2,%eax
  106053:	89 c1                	mov    %eax,%ecx
    asm volatile (
  106055:	8b 55 f4             	mov    -0xc(%ebp),%edx
  106058:	8b 45 f0             	mov    -0x10(%ebp),%eax
  10605b:	89 d7                	mov    %edx,%edi
  10605d:	89 c6                	mov    %eax,%esi
  10605f:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
  106061:	8b 4d ec             	mov    -0x14(%ebp),%ecx
  106064:	83 e1 03             	and    $0x3,%ecx
  106067:	74 02                	je     10606b <memcpy+0x38>
  106069:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
  10606b:	89 f0                	mov    %esi,%eax
  10606d:	89 fa                	mov    %edi,%edx
  10606f:	89 4d e8             	mov    %ecx,-0x18(%ebp)
  106072:	89 55 e4             	mov    %edx,-0x1c(%ebp)
  106075:	89 45 e0             	mov    %eax,-0x20(%ebp)
    return dst;
  106078:	8b 45 f4             	mov    -0xc(%ebp),%eax
    while (n -- > 0) {
        *d ++ = *s ++;
    }
    return dst;
#endif /* __HAVE_ARCH_MEMCPY */
}
  10607b:	83 c4 20             	add    $0x20,%esp
  10607e:	5e                   	pop    %esi
  10607f:	5f                   	pop    %edi
  106080:	5d                   	pop    %ebp
  106081:	c3                   	ret    

00106082 <memcmp>:
 *   match in both memory blocks has a greater value in @v1 than in @v2
 *   as if evaluated as unsigned char values;
 * - And a value less than zero indicates the opposite.
 * */
int
memcmp(const void *v1, const void *v2, size_t n) {
  106082:	55                   	push   %ebp
  106083:	89 e5                	mov    %esp,%ebp
  106085:	83 ec 10             	sub    $0x10,%esp
    const char *s1 = (const char *)v1;
  106088:	8b 45 08             	mov    0x8(%ebp),%eax
  10608b:	89 45 fc             	mov    %eax,-0x4(%ebp)
    const char *s2 = (const char *)v2;
  10608e:	8b 45 0c             	mov    0xc(%ebp),%eax
  106091:	89 45 f8             	mov    %eax,-0x8(%ebp)
    while (n -- > 0) {
  106094:	eb 2e                	jmp    1060c4 <memcmp+0x42>
        if (*s1 != *s2) {
  106096:	8b 45 fc             	mov    -0x4(%ebp),%eax
  106099:	0f b6 10             	movzbl (%eax),%edx
  10609c:	8b 45 f8             	mov    -0x8(%ebp),%eax
  10609f:	0f b6 00             	movzbl (%eax),%eax
  1060a2:	38 c2                	cmp    %al,%dl
  1060a4:	74 18                	je     1060be <memcmp+0x3c>
            return (int)((unsigned char)*s1 - (unsigned char)*s2);
  1060a6:	8b 45 fc             	mov    -0x4(%ebp),%eax
  1060a9:	0f b6 00             	movzbl (%eax),%eax
  1060ac:	0f b6 d0             	movzbl %al,%edx
  1060af:	8b 45 f8             	mov    -0x8(%ebp),%eax
  1060b2:	0f b6 00             	movzbl (%eax),%eax
  1060b5:	0f b6 c8             	movzbl %al,%ecx
  1060b8:	89 d0                	mov    %edx,%eax
  1060ba:	29 c8                	sub    %ecx,%eax
  1060bc:	eb 18                	jmp    1060d6 <memcmp+0x54>
        }
        s1 ++, s2 ++;
  1060be:	ff 45 fc             	incl   -0x4(%ebp)
  1060c1:	ff 45 f8             	incl   -0x8(%ebp)
    while (n -- > 0) {
  1060c4:	8b 45 10             	mov    0x10(%ebp),%eax
  1060c7:	8d 50 ff             	lea    -0x1(%eax),%edx
  1060ca:	89 55 10             	mov    %edx,0x10(%ebp)
  1060cd:	85 c0                	test   %eax,%eax
  1060cf:	75 c5                	jne    106096 <memcmp+0x14>
    }
    return 0;
  1060d1:	b8 00 00 00 00       	mov    $0x0,%eax
}
  1060d6:	89 ec                	mov    %ebp,%esp
  1060d8:	5d                   	pop    %ebp
  1060d9:	c3                   	ret    
